
4 Aug
2009
4 Aug
'09
7:58 p.m.
Christian Schladetsch wrote:
This is largely what I did. The allocation model used by Cloneable is based on covariant virtual methods that are passed an 'abstract allocator' which takes the alignment as an argument.
struct abstract_allocator { typedef char *pointer; virtual pointer allocate_bytes(size_t num_bytes, size_t alignment) = 0; virtual void deallocate_bytes(pointer, size_t alignment) = 0; static size_t calc_padding(pointer ptr, size_t alignment); };
Ok, I see. But what gains does using a special container give?