bpo-32759: Free unused arenas in multiprocessing.heap by pitrou · Pull Request #5827 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started reviewing yesterday, but it will take some time to grok this code.
| if new_stop < stop: | ||
| self._free((arena, new_stop, stop)) | ||
| self._add_free_block((arena, new_stop, stop)) | ||
| block = (arena, start, new_stop) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The block variable can be inlined now.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed :-)
but it will take some time to grok this code.
Yes, it's a mini-memory allocator here. Not too complex fortunately.
I adressed the review comment and added some comments to try and explain the allocator a bit more.
If there are no further review comments, I will merge this PR.
pitrou
deleted the
mp_heap_arena_free
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters