Made the malloc-based allocator less wasteful.