Memory allocator code for class.