version with Allocator interface