Implementation of malloc, free, realloc and a function to show current memory state.