1 #pragma once 2 3 #include <cstdlib> 4 5 static inline void* mfree(void* memory) 6 { 7 free(memory); 8 return NULL; 9 } 10 11 static 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