Added include for malloc.h to mem.c for portability (malloc_usable_size was giving warnings about implicit declaration on some systems).