snmalloc icon indicating copy to clipboard operation
snmalloc copied to clipboard

Extend secondary allocation support

Open mjp41 opened this issue 1 year ago • 1 comments

Here are some thoughts for things we can do

  • [ ] Add support for refilling the free list to a particular size, e.g. refill(LocalCache&, sizeclass, size_t& request). refill will add at most request entries to the freelist, removes the count of added entries from request.
  • [ ] Using modified refill adapt GWP-Asan sampling to accurately reflect the sampling request from the user.
  • [ ] Add documentation for building with GWP-Asan.
  • [ ] Automate downloading GWP-Asan.
  • [ ] Provide support for Windows using detours, and a secondary allocator of the original Windows Heap.
  • [ ] Build sampling profiler using secondary allocator.
  • [ ] Add C++ Concept
  • [x] Enable out of tree override of secondary allocator.

This is a bit of a brain dump of things I think this feature enables. My thought is to try to get a reasonable number of these together, and release as 0.8.0.

@SchrodingerZhu, or anyone else, please feel free to add your own ideas on use cases.

mjp41 avatar Feb 05 '25 09:02 mjp41

It would be also good to make a concept with static_assert for c++20.

SchrodingerZhu avatar Feb 05 '25 16:02 SchrodingerZhu