adding custom memory allocator support