Skip to content

gh-113055: Use pointer for interp->obmalloc state.#113412

Merged
nascheme merged 5 commits intopython:mainfrom
nascheme:obmalloc_state_ptr
Jan 27, 2024
Merged

gh-113055: Use pointer for interp->obmalloc state.#113412
nascheme merged 5 commits intopython:mainfrom
nascheme:obmalloc_state_ptr

Conversation

@nascheme
Copy link
Member

@nascheme nascheme commented Dec 22, 2023

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.

Note that the free is only done if obmalloc used blocks is zero. If some blocks are used, it's not safe to free the memory since some extension might still be using it.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants