-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layering snmalloc on top of another allocator #697
Comments
@nwf @davidchisnall @SchrodingerZhu any thoughts on this? Seems reasonably low effort to potential reward. |
First, this does seem like a good idea. |
Actually, I checked the Scudo interface. API-wise I think GWPASan are easier to work with. Let me check more about how scudo is integrating GWPASan and I can report back. |
Thanks for investigating. Reading that file, we also need to do some integration around realloc/malloc_usable_size. I'm not sure if we can find the start of an object easily with GWP-Asan to get external_pointer working as well. @SchrodingerZhu I won't have time to work on this for a while, so if you're interested you are welcome to have a go. Otherwise I'll try to find some time, but it might be a month or two. |
I see no real harm in the proposed refactoring to allow for compile-time pluggable behaviors here. Just to state the obvious: the branch on the One nit-picky, but just to say... in the example above, the |
There are cases where it would be useful for snmalloc to pass certain requests to a different allocator.
The documentation for GWP-Asan has
This I think should involve a concept of the shape:
We would put calls on the slow path for allocation
snmalloc/src/snmalloc/mem/corealloc.h
Line 881 in 33b7f65
snmalloc/src/snmalloc/mem/localalloc.h
Line 186 in 33b7f65
This would involve adding something like
For deallocation there would just be a change here:
snmalloc/src/snmalloc/mem/localalloc.h
Lines 698 to 704 in 33b7f65
This would involve adding code like
SecondaryAllocator::free(p_tame);
We could then define a Default class as
and for GWP something line
Providing a
SecondaryAllocator
as a compile time option would allow us to integrate various systems cleanly.Unknowns
class CommonConfig
, and override by specific configurations.The text was updated successfully, but these errors were encountered: