https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87736
Bug ID: 87736
Summary: New attributes to mark custom alloc/free function pair
Product: gcc
Version: 8.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
This is split from Bug 87731, as recommended by Jonathan Wakely:
Valgrind 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*);