summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_obmalloc.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-92953: Improve nextpool/prevpool comment. (gh-125545)Neil Schemenauer2024-10-151-2/+2
| | | | The meaning of these links depends on which list the pool is part of. They are only the same size class if on the "usedpools" list.
* gh-113055: Use pointer for interp->obmalloc state (gh-113412)Neil Schemenauer2024-01-271-0/+2
| | | | | | | | | For interpreters that share state with the main interpreter, this points to the same static memory structure. For interpreters with their own obmalloc state, it is heap allocated. Add free_obmalloc_arenas() which will free the obmalloc arenas and radix tree structures for interpreters with their own obmalloc state. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-112867: fix for WITH_PYMALLOC_RADIX_TREE=0 (GH-112885)Neil Schemenauer2023-12-091-0/+2
| | | | The _obmalloc_usage structure is only defined if the obmalloc radix tree is enabled.
* gh-107211: No longer export internal functions (6) (#108424)Victor Stinner2023-08-241-1/+1
| | | | | | | | | | | | No longer export these 5 internal C API functions: * _PyArena_AddPyObject() * _PyArena_Free() * _PyArena_Malloc() * _PyArena_New() * _Py_FatalRefcountErrorFunc() Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-101659: Isolate "obmalloc" State to Each Interpreter (gh-101660)Eric Snow2023-04-241-2/+10
| | | | | | | | | | | | | | This is strictly about moving the "obmalloc" runtime state from `_PyRuntimeState` to `PyInterpreterState`. Doing so improves isolation between interpreters, specifically most of the memory (incl. objects) allocated for each interpreter's use. This is important for a per-interpreter GIL, but such isolation is valuable even without it. FWIW, a per-interpreter obmalloc is the proverbial canary-in-the-coalmine when it comes to the isolation of objects between interpreters. Any object that leaks (unintentionally) to another interpreter is highly likely to cause a crash (on debug builds at least). That's a useful thing to know, relative to interpreter isolation.
* gh-81057: Move More Globals to _PyRuntimeState (gh-100092)Eric Snow2022-12-071-0/+1
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-111-0/+689
The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057