diff options
author | Pieter Eendebak <pieter.eendebak@gmail.com> | 2024-12-13 10:06:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-13 10:06:26 (GMT) |
commit | 5fc6bb2754a25157575efc0b37da78c629fea46e (patch) | |
tree | fca4a299618f0a4d93c68bc524ba6e192341d234 /Include | |
parent | 9b4bbf4401291636e5db90511a0548fffb23a505 (diff) | |
download | cpython-5fc6bb2754a25157575efc0b37da78c629fea46e.zip cpython-5fc6bb2754a25157575efc0b37da78c629fea46e.tar.gz cpython-5fc6bb2754a25157575efc0b37da78c629fea46e.tar.bz2 |
gh-126868: Add freelist for compact int objects (GH-126865)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_freelist_state.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_long.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Include/internal/pycore_freelist_state.h b/Include/internal/pycore_freelist_state.h index 4e04cf4..a1a94c1 100644 --- a/Include/internal/pycore_freelist_state.h +++ b/Include/internal/pycore_freelist_state.h @@ -14,6 +14,7 @@ extern "C" { # define Py_dicts_MAXFREELIST 80 # define Py_dictkeys_MAXFREELIST 80 # define Py_floats_MAXFREELIST 100 +# define Py_ints_MAXFREELIST 100 # define Py_slices_MAXFREELIST 1 # define Py_contexts_MAXFREELIST 255 # define Py_async_gens_MAXFREELIST 80 @@ -35,6 +36,7 @@ struct _Py_freelist { struct _Py_freelists { struct _Py_freelist floats; + struct _Py_freelist ints; struct _Py_freelist tuples[PyTuple_MAXSAVESIZE]; struct _Py_freelist lists; struct _Py_freelist dicts; diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h index 196b415..8bead00 100644 --- a/Include/internal/pycore_long.h +++ b/Include/internal/pycore_long.h @@ -55,6 +55,8 @@ extern void _PyLong_FiniTypes(PyInterpreterState *interp); /* other API */ +PyAPI_FUNC(void) _PyLong_ExactDealloc(PyObject *self); + #define _PyLong_SMALL_INTS _Py_SINGLETON(small_ints) // _PyLong_GetZero() and _PyLong_GetOne() must always be available |