[compiler-rt] [scudo] Add primary option to zero block on dealloc. (PR #142394)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 08:13:31 PDT 2025


piwicode wrote:

> I think this is better to be done in `deallocate()` path in combined.h.

- Zeroing is only useful for the primary allocator, where objects are small, and when all objects of a given page are zeroed, the page can be reclaimed by the OS. The secondary allocator can affort to simply releases the memory to the operating system because it is working on large objects.
- In combined.h there are also two code path to deallocate depending on whenever the block is quarantined or not.
 
That why it is implemented the SizeClassAllocator. Can you double check and let me know if you prefer to move this code to `combined.h`?

https://github.com/llvm/llvm-project/pull/142394


More information about the llvm-commits mailing list