-
Notifications
You must be signed in to change notification settings - Fork 464
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
Hooking into tcmalloc allocations and deallocations? #44
Comments
There have been internal discussion around alternative, more-featureful APIs for malloc hooks, but these aren't quite ready yet. |
Have there been any updates/future considerations on this @ckennelly? |
I just hit this as well, trying to update from gperftools to this version. We use these hooks to disallow allocations in hard realtime code. Any hints on where to patch in a callback until the more featureful API merges? |
@AustinSchuh operator new and malloc and the like are implemented as attribute(alias(TcmallocInternalNew)) or something like that. You could alias that to your hook function instead and then call InternalNew yourself The other option is dynamically loading with dlsym and monkey-patching the function symbol to your own function |
Is there an equivalent in tcmalloc to gperftool's interfaces found in malloc_hook.h, such as AddNewHook and AddDeleteHook?
The text was updated successfully, but these errors were encountered: