1 #pragma once 2 3 #include <cstdlib> 4 mfree(void * memory)5static inline void* mfree(void* memory) 6 { 7 free(memory); 8 return NULL; 9 } 10 freep(void * p)11static inline void freep(void* p) 12 { 13 *(void**)p = mfree(*(void**)p); 14 } 15 #define _cleanup_free_ _cleanup_(freep) 16 #define _cleanup_(x) __attribute__((__cleanup__(x))) 17