diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python.h | 8 | ||||
-rw-r--r-- | Include/object.h | 4 | ||||
-rw-r--r-- | Include/objimpl.h | 19 |
3 files changed, 8 insertions, 23 deletions
diff --git a/Include/Python.h b/Include/Python.h index ff21ad1..d4afdaf 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -23,6 +23,14 @@ #include "patchlevel.h" #include "pyconfig.h" +/* Cyclic gc is always enabled, starting with release 2.3a1. Supply the + * old symbol for the benefit of extension modules written before then + * that may be conditionalizing on it. The core doesn't use it anymore. + */ +#ifndef WITH_CYCLE_GC +#define WITH_CYCLE_GC 1 +#endif + #ifdef HAVE_LIMITS_H #include <limits.h> #endif diff --git a/Include/object.h b/Include/object.h index a742fd8..7bb1eac 100644 --- a/Include/object.h +++ b/Include/object.h @@ -441,11 +441,7 @@ given type object has a specified feature. #define Py_TPFLAGS_READYING (1L<<13) /* Objects support garbage collection (see objimp.h) */ -#ifdef WITH_CYCLE_GC #define Py_TPFLAGS_HAVE_GC (1L<<14) -#else -#define Py_TPFLAGS_HAVE_GC 0 -#endif #define Py_TPFLAGS_DEFAULT ( \ Py_TPFLAGS_HAVE_GETCHARBUFFER | \ diff --git a/Include/objimpl.h b/Include/objimpl.h index 3a7488a..730b032 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -226,10 +226,6 @@ extern DL_IMPORT(PyVarObject *) _PyObject_NewVar(PyTypeObject *, int); /* * Garbage Collection Support * ========================== - * - * Some of the functions and macros below are always defined; when - * WITH_CYCLE_GC is undefined, they simply don't do anything different - * than their non-GC counterparts. */ /* Test if a type has a GC head */ @@ -246,8 +242,6 @@ extern DL_IMPORT(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int); /* for source compatibility with 2.2 */ #define _PyObject_GC_Del PyObject_GC_Del -#ifdef WITH_CYCLE_GC - /* GC information is stored BEFORE the object structure. */ typedef union _gc_head { struct { @@ -305,19 +299,6 @@ extern DL_IMPORT(void) PyObject_GC_Del(void *); ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) -#else /* !WITH_CYCLE_GC */ - -#define _PyObject_GC_Malloc PyObject_Malloc -#define PyObject_GC_New PyObject_New -#define PyObject_GC_NewVar PyObject_NewVar -#define PyObject_GC_Del PyObject_Del -#define _PyObject_GC_TRACK(op) -#define _PyObject_GC_UNTRACK(op) -#define PyObject_GC_Track(op) -#define PyObject_GC_UnTrack(op) - -#endif - /* This is here for the sake of backwards compatibility. Extensions that * use the old GC API will still compile but the objects will not be * tracked by the GC. */ |