Implementations for a malloc function.