mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Implemented Martin's suggestion to clear the free lists during the garbage collection of the highest generation.
This commit is contained in:
parent
50361d4d9b
commit
3b718a79af
15 changed files with 131 additions and 25 deletions
|
|
@ -74,6 +74,7 @@ PyAPI_FUNC(PyObject *) _PyInstance_Lookup(PyObject *pinst, PyObject *name);
|
|||
|
||||
PyAPI_FUNC(int) PyClass_IsSubclass(PyObject *, PyObject *);
|
||||
|
||||
PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
|
|||
PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
|
||||
PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *);
|
||||
|
||||
PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ typedef struct {
|
|||
PyObject *m_module; /* The __module__ attribute, can be anything */
|
||||
} PyCFunctionObject;
|
||||
|
||||
PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
|
|||
/* Macro, *only* to be used to fill in brand new tuples */
|
||||
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
|
||||
|
||||
PyAPI_FUNC(int) PyTuple_ClearFreeList(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
|
|||
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString
|
||||
# define _PyUnicode_Fini _PyUnicodeUCS2_Fini
|
||||
# define _PyUnicode_Init _PyUnicodeUCS2_Init
|
||||
# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
|
||||
# define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha
|
||||
# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit
|
||||
# define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit
|
||||
|
|
@ -295,6 +296,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
|
|||
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString
|
||||
# define _PyUnicode_Fini _PyUnicodeUCS4_Fini
|
||||
# define _PyUnicode_Init _PyUnicodeUCS4_Init
|
||||
# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
|
||||
# define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha
|
||||
# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit
|
||||
# define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit
|
||||
|
|
@ -403,6 +405,8 @@ extern const unsigned char _Py_ascii_whitespace[];
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
|
||||
|
||||
/* --- Unicode Type ------------------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue