gh-123990: Good bye WITH_FREELISTS macro (gh-124358)

This commit is contained in:
Donghee Na 2024-09-23 18:28:59 -07:00 committed by GitHub
parent be76e3f26e
commit ad7c778546
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 4 additions and 100 deletions

View file

@ -28,13 +28,6 @@ _Py_freelists_GET(void)
#endif
}
#ifndef WITH_FREELISTS
#define _Py_FREELIST_FREE(NAME, op, freefunc) freefunc(op)
#define _Py_FREELIST_PUSH(NAME, op, limit) (0)
#define _Py_FREELIST_POP(TYPE, NAME) (NULL)
#define _Py_FREELIST_POP_MEM(NAME) (NULL)
#define _Py_FREELIST_SIZE(NAME) (0)
#else
// Pushes `op` to the freelist, calls `freefunc` if the freelist is full
#define _Py_FREELIST_FREE(NAME, op, freefunc) \
_PyFreeList_Free(&_Py_freelists_GET()->NAME, _PyObject_CAST(op), \
@ -108,7 +101,6 @@ _PyFreeList_PopMem(struct _Py_freelist *fl)
}
return op;
}
#endif
extern void _PyObject_ClearFreeLists(struct _Py_freelists *freelists, int is_finalization);

View file

@ -8,8 +8,6 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
#ifdef WITH_FREELISTS
// with freelists
# define PyTuple_MAXSAVESIZE 20 // Largest tuple to save on freelist
# define Py_tuple_MAXFREELIST 2000 // Maximum number of tuples of each size to save
# define Py_lists_MAXFREELIST 80
@ -22,9 +20,6 @@ extern "C" {
# define Py_async_gen_asends_MAXFREELIST 80
# define Py_futureiters_MAXFREELIST 255
# define Py_object_stack_chunks_MAXFREELIST 4
#else
# define PyTuple_MAXSAVESIZE 0
#endif
// A generic freelist of either PyObjects or other data structures.
struct _Py_freelist {
@ -38,7 +33,6 @@ struct _Py_freelist {
};
struct _Py_freelists {
#ifdef WITH_FREELISTS
struct _Py_freelist floats;
struct _Py_freelist tuples[PyTuple_MAXSAVESIZE];
struct _Py_freelist lists;
@ -50,9 +44,6 @@ struct _Py_freelists {
struct _Py_freelist async_gen_asends;
struct _Py_freelist futureiters;
struct _Py_freelist object_stack_chunks;
#else
char _unused; // Empty structs are not allowed.
#endif
};
#ifdef __cplusplus