diff --git a/include/util.h b/include/util.h index 3541bdc..3ec7225 100644 --- a/include/util.h +++ b/include/util.h @@ -89,6 +89,9 @@ bool utilMatchPrefix(const char* lhs, const char* rhs, int sz); #define UTIL_ALLOC(len, type) (type *) utilLogAlloc((len), sizeof(type), __FILE__, __LINE__) void* utilLogAlloc(uint item_count, uint type_size, const char* file_name, const int line); +// TODO: replace instances of 'utilSafeFree()' with macro that casts to void +// pointer reference. Can then set the pointer to nullptr in free function +#define UTIL_FREE(mem_ptr) utilSafeFree((void*&) mem_ptr) void utilSafeFree(const void* mem); //-----------------