Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks() #14680
Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
tim-one left a comment
Surprising! Good catch. I doubt this function is ever used outside of memory-leak detectors, so its speed is hard to care about. I'm just asking for a change to round the arena base address up to the first pool's actual address (which probably isn't really needed on Linux or Windows, but will be needed if pool sizes ever increase beyond the OS page size).