Make allocator API generic.