Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-111968: Rename _Py_freelist_state to _PyObject_freelists
  • Loading branch information
corona10 committed Feb 12, 2024
commit e235b100c91d1e4e4deca31478dd9546c50ea25e
2 changes: 1 addition & 1 deletion Include/internal/pycore_freelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct _Py_object_stack_state {
Py_ssize_t numfree;
};

typedef struct _Py_freelist_state {
typedef struct _PyObject_freelists {
struct _Py_float_state floats;
struct _Py_tuple_state tuples;
struct _Py_list_state lists;
Expand Down
4 changes: 0 additions & 4 deletions Include/internal/pycore_interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern "C" {
#include "pycore_dtoa.h" // struct _dtoa_state
#include "pycore_exceptions.h" // struct _Py_exc_state
#include "pycore_floatobject.h" // struct _Py_float_state
#include "pycore_freelist.h" // struct _Py_freelist_state
#include "pycore_function.h" // FUNC_MAX_WATCHERS
#include "pycore_gc.h" // struct _gc_runtime_state
#include "pycore_genobject.h" // struct _Py_async_gen_state
Expand Down Expand Up @@ -222,9 +221,6 @@ struct _is {
// One bit is set for each non-NULL entry in code_watchers
uint8_t active_code_watchers;

#if !defined(Py_GIL_DISABLED)
struct _Py_freelist_state freelist_state;
#endif
struct _py_object_state object_state;
struct _Py_unicode_state unicode;
struct _Py_long_state long_state;
Expand Down
4 changes: 4 additions & 0 deletions Include/internal/pycore_object_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

#include "pycore_freelist.h" // _PyObject_freelists
#include "pycore_hashtable.h" // _Py_hashtable_t

struct _py_object_runtime_state {
Expand All @@ -18,6 +19,9 @@ struct _py_object_runtime_state {
};

struct _py_object_state {
#if !defined(Py_GIL_DISABLED)
struct _PyObject_freelists freelists;
#endif
#ifdef Py_REF_DEBUG
Py_ssize_t reftotal;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static inline _PyFreeListState* _PyFreeListState_GET(void)
#ifdef Py_GIL_DISABLED
return &((_PyThreadStateImpl*)tstate)->freelist_state;
#else
return &tstate->interp->freelist_state;
return &tstate->interp->object_state.freelists;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_tstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef struct _PyThreadStateImpl {

#ifdef Py_GIL_DISABLED
struct _mimalloc_thread_state mimalloc;
struct _Py_freelist_state freelist_state;
struct _PyObject_freelists freelist_state;
struct _brc_thread_state brc;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Python/gc_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
void
_PyGC_ClearAllFreeLists(PyInterpreterState *interp)
{
_PyObject_ClearFreeLists(&interp->freelist_state, 0);
_PyObject_ClearFreeLists(&interp->object_state.freelists, 0);
}

#endif