This is a memory management implementation to replace malloc in C.