google / tcmalloc

Apache License 2.0
4.23k stars 456 forks source link

Hooking into tcmalloc allocations and deallocations? #44

Open rjaber opened 3 years ago

rjaber commented 3 years ago

Is there an equivalent in tcmalloc to gperftool's interfaces found in malloc_hook.h, such as AddNewHook and AddDeleteHook?

ckennelly commented 3 years ago

There have been internal discussion around alternative, more-featureful APIs for malloc hooks, but these aren't quite ready yet.

erin2722 commented 4 months ago

Have there been any updates/future considerations on this @ckennelly?

AustinSchuh commented 2 weeks ago

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?