summaryrefslogtreecommitdiffstats
path: root/Include/cpython/objimpl.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45947: Place dict and values pointer at fixed (negative) offset just ↵Mark Shannon2021-12-071-3/+0
| | | | | | | | | | | | | | | | | | | before GC header. (GH-29879) * Place __dict__ immediately before GC header for plain Python objects. * Fix up lazy dict creation logic to use managed dict pointers. * Manage values pointer, placing them directly before managed dict pointers. * Convert hint-based load/store attr specialization target managed dict classes. * Specialize LOAD_METHOD for managed dict objects. * Remove unsafe _PyObject_GC_Calloc function. * Remove unsafe _PyObject_GC_Malloc() function. * Add comment explaning use of Py_TPFLAGS_MANAGED_DICT.
* bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)Victor Stinner2020-10-301-4/+0
| | | | | | | | | | | | Move private _PyGC_CollectNoFail() to the internal C API. Remove the private _PyGC_CollectIfEnabled() which was just an alias to the public PyGC_Collect() function since Python 3.8. Rename functions: * collect() => gc_collect_main() * collect_with_callback() => gc_collect_with_callback() * collect_generations() => gc_collect_generations()
* bpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901)Victor Stinner2020-06-151-36/+3
| | | | | | | | | | | | | | The PyObject_INIT() and PyObject_INIT_VAR() macros become aliases to, respectively, PyObject_Init() and PyObject_InitVar() functions. Rename _PyObject_INIT() and _PyObject_INIT_VAR() static inline functions to, respectively, _PyObject_Init() and _PyObject_InitVar(), and move them to pycore_object.h. Remove their return value: their return type becomes void. The _datetime module is now built with the Py_BUILD_CORE_MODULE macro defined. Remove an outdated comment on _Py_tracemalloc_config.
* bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h ↵Skip Montanaro2020-06-011-8/+0
| | | | (GH-18413)
* bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464)Hai Shi2020-04-141-4/+3
|
* bpo-40241: Add pycore_gc.h header file (GH-19494)Victor Stinner2020-04-131-55/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the PyGC_Head structure and the following private macros to the internal C API: * _PyGCHead_FINALIZED() * _PyGCHead_NEXT() * _PyGCHead_PREV() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * _PyGCHead_SET_PREV() * _PyGC_FINALIZED() * _PyGC_PREV_MASK * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_SHIFT * _PyGC_SET_FINALIZED() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * _Py_AS_GC(o) Keep the private _PyGC_FINALIZED() macro in the public C API for backward compatibility with Python 3.8: make it an alias to the new PyObject_GC_IsFinalized() function. Move the SIZEOF_PYGC_HEAD constant from _testcapi module to _testinternalcapi module.
* bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)Victor Stinner2020-04-071-0/+50
| | | | | | | | | | | | The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar().
* bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)Victor Stinner2020-04-061-2/+1
| | | | | | | | Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API.
* bpo-39573: Add Py_SET_SIZE() function (GH-18400)Victor Stinner2020-02-071-1/+1
| | | Add Py_SET_SIZE() function to set the size of an object.
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-071-1/+1
| | | Add Py_SET_TYPE() function to set the type of an object.
* bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)Victor Stinner2020-02-051-0/+33
| | | | | | | | | | | | | | In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now defined as aliases to PyObject_Init() and PyObject_InitVar() to make their implementation opaque. It avoids to leak implementation details in the limited C API. Exclude the following functions from the limited C API, move them from object.h to cpython/object.h: * _Py_NewReference() * _Py_ForgetReference() * _PyTraceMalloc_NewReference() * _Py_GetRefTotal()
* bpo-35134: Create Include/cpython/ subdirectory (GH-10624)Victor Stinner2018-11-231-0/+113
Include/*.h should be the "portable Python API", whereas Include/cpython/*.h should be the "CPython API": CPython implementation details. Changes: * Create Include/cpython/ subdirectory * "make install" now creates $prefix/include/cpython and copy Include/cpython/* to $prefix/include/cpython * Create Include/cpython/objimpl.h: move objimpl.h code surrounded by "#ifndef Py_LIMITED_API" to cpython/objimpl.h. * objimpl.h now includes cpython/objimpl.h * Windows installer (MSI) now also install Include/ subdirectories: Include/cpython/ and Include/internal/.