https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87731
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Daniel Fruzynski from comment #0) > Valgrind also provides set of macros which allows it to track custom > alloc/free functions. It would be nice if you add new attributes which could > be attached to custom alloc and free functions, so gcc could check pairing > for them too. I think of something like this: > > __attribute__((malloc("MyAllocType"))) > void* MyAlloc(size_t); > > __attribute__((free("MyAllocType"))) > void MyFree(void*); That should be a separate enhancement request.