malloc, free, realloc, calloc from scratch