mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-110481: Implement biased reference counting (gh-110764)
This commit is contained in:
parent
05f2f0ac92
commit
6dfb8fe023
29 changed files with 511 additions and 52 deletions
|
@ -129,13 +129,13 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
.latin1 = _Py_str_latin1_INIT, \
|
||||
}, \
|
||||
.tuple_empty = { \
|
||||
.ob_base = _PyVarObject_HEAD_INIT(&PyTuple_Type, 0) \
|
||||
.ob_base = _PyVarObject_HEAD_INIT(&PyTuple_Type, 0), \
|
||||
}, \
|
||||
.hamt_bitmap_node_empty = { \
|
||||
.ob_base = _PyVarObject_HEAD_INIT(&_PyHamt_BitmapNode_Type, 0) \
|
||||
.ob_base = _PyVarObject_HEAD_INIT(&_PyHamt_BitmapNode_Type, 0), \
|
||||
}, \
|
||||
.context_token_missing = { \
|
||||
.ob_base = _PyObject_HEAD_INIT(&_PyContextTokenMissing_Type) \
|
||||
.ob_base = _PyObject_HEAD_INIT(&_PyContextTokenMissing_Type), \
|
||||
}, \
|
||||
}, \
|
||||
}, \
|
||||
|
@ -172,11 +172,11 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
.singletons = { \
|
||||
._not_used = 1, \
|
||||
.hamt_empty = { \
|
||||
.ob_base = _PyObject_HEAD_INIT(&_PyHamt_Type) \
|
||||
.ob_base = _PyObject_HEAD_INIT(&_PyHamt_Type), \
|
||||
.h_root = (PyHamtNode*)&_Py_SINGLETON(hamt_bitmap_node_empty), \
|
||||
}, \
|
||||
.last_resort_memory_error = { \
|
||||
_PyObject_HEAD_INIT(&_PyExc_MemoryError) \
|
||||
_PyObject_HEAD_INIT(&_PyExc_MemoryError), \
|
||||
.args = (PyObject*)&_Py_SINGLETON(tuple_empty) \
|
||||
}, \
|
||||
}, \
|
||||
|
@ -206,7 +206,7 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
|
||||
#define _PyBytes_SIMPLE_INIT(CH, LEN) \
|
||||
{ \
|
||||
_PyVarObject_HEAD_INIT(&PyBytes_Type, (LEN)) \
|
||||
_PyVarObject_HEAD_INIT(&PyBytes_Type, (LEN)), \
|
||||
.ob_shash = -1, \
|
||||
.ob_sval = { (CH) }, \
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
|
||||
#define _PyUnicode_ASCII_BASE_INIT(LITERAL, ASCII) \
|
||||
{ \
|
||||
.ob_base = _PyObject_HEAD_INIT(&PyUnicode_Type) \
|
||||
.ob_base = _PyObject_HEAD_INIT(&PyUnicode_Type), \
|
||||
.length = sizeof(LITERAL) - 1, \
|
||||
.hash = -1, \
|
||||
.state = { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue