mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
part 2 of Neil Schemenauer's GC patches:
This patch modifies the type structures of objects that participate in GC. The object's tp_basicsize is increased when GC is enabled. GC information is prefixed to the object to maintain binary compatibility. GC objects also define the tp_flag Py_TPFLAGS_GC.
This commit is contained in:
parent
d22162bac7
commit
d08b4c4524
7 changed files with 36 additions and 20 deletions
|
@ -325,6 +325,13 @@ given type object has a specified feature.
|
|||
/* PySequenceMethods contains sq_contains */
|
||||
#define Py_TPFLAGS_HAVE_SEQUENCE_IN (1L<<1)
|
||||
|
||||
/* Objects which participate in garbage collection (see objimp.h) */
|
||||
#ifdef WITH_CYCLE_GC
|
||||
#define Py_TPFLAGS_GC (1L<<2)
|
||||
#else
|
||||
#define Py_TPFLAGS_GC 0
|
||||
#endif
|
||||
|
||||
#define Py_TPFLAGS_DEFAULT (Py_TPFLAGS_HAVE_GETCHARBUFFER | \
|
||||
Py_TPFLAGS_HAVE_SEQUENCE_IN)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue