If allocator is NULL, assign default allocators