Add custom memory allocator.
Allocate objects on heap.