macro for malloc and free and realloc