#ifndef MEMORY_H # define MEMORY_H typedef struct { void *(*allocateFileLine) (int bytes, const char *file, int line); void *(*reallocateFileLine)(void *ptr, int bytes, const char *file, int line); void (*deallocateFileLine)(void *ptr, const char *file, int line); } MemoryFunctions; extern MemoryFunctions Memory; # define FL __FILE__, __LINE__ # define allocate(bytes) allocateFileLine(bytes, FL) # define reallocate(ptr, bytes) reallocateFileLine(ptr, bytes, FL) # define deallocate(ptr) deallocateFileLine(ptr, FL) // Set to 1 for debug memory allocation/freeing output # define M_DEBUG (0) #endif