Rename memoryManagerAddRecord to memoryManagerAllocateRecord
Implement safeFree