cpython/Include/internal/pycore_freelist.h

#ifndef Py_INTERNAL_FREELIST_H
#define Py_INTERNAL_FREELIST_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

#include "pycore_freelist_state.h"      // struct _Py_freelists
#include "pycore_object.h"              // _PyObject_IS_GC
#include "pycore_pystate.h"             // _PyThreadState_GET
#include "pycore_code.h"                // OBJECT_STAT_INC

static inline struct _Py_freelists *
_Py_freelists_GET(void)
{}

// Pushes `op` to the freelist, calls `freefunc` if the freelist is full
#define _Py_FREELIST_FREE(NAME, op, freefunc)
// Pushes `op` to the freelist, returns 1 if successful, 0 if the freelist is full
#define _Py_FREELIST_PUSH(NAME, op, limit)

// Pops a PyObject from the freelist, returns NULL if the freelist is empty.
#define _Py_FREELIST_POP(TYPE, NAME)

// Pops a non-PyObject data structure from the freelist, returns NULL if the
// freelist is empty.
#define _Py_FREELIST_POP_MEM(NAME)

#define _Py_FREELIST_SIZE(NAME)

static inline int
_PyFreeList_Push(struct _Py_freelist *fl, void *obj, Py_ssize_t maxsize)
{}

static inline void
_PyFreeList_Free(struct _Py_freelist *fl, void *obj, Py_ssize_t maxsize,
                 freefunc dofree)
{}

static inline void *
_PyFreeList_PopNoStats(struct _Py_freelist *fl)
{}

static inline PyObject *
_PyFreeList_Pop(struct _Py_freelist *fl)
{}

static inline void *
_PyFreeList_PopMem(struct _Py_freelist *fl)
{}

extern void _PyObject_ClearFreeLists(struct _Py_freelists *freelists, int is_finalization);

#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_FREELIST_H */