Custom implementation of malloc, realloc, calloc, free