gh-113055: Use pointer for interp->obmalloc state (gh-113412)

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>
This commit is contained in:
Neil Schemenauer 2024-01-26 19:38:14 -08:00 committed by GitHub
parent 2d08af34b8
commit 7a7bce5a0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 157 additions and 24 deletions

View file

@ -155,7 +155,6 @@ extern PyTypeObject _PyExc_MemoryError;
{ \
.id_refcount = -1, \
.imports = IMPORTS_INIT, \
.obmalloc = _obmalloc_state_INIT(INTERP.obmalloc), \
.ceval = { \
.recursion_limit = Py_DEFAULT_RECURSION_LIMIT, \
}, \