Enhanced allocator to support allocation in non-heap memory.