Implemented mem_alloc() and mem_calloc() in mem.c