DBC: I don't think decoupling things that are tightly coupled (ike allocation
and deallocation) into separate classes is the right way.

One simple approach would be to have a single allocator classes with interface
like:

class SomeAllocator {
 INLINE(void* New(size_t size));
 INLINE(static void Delete(void* p));
};

And parameterize our containers with it. If Allocator needs any booking data to correctly free p it will prepend it to the allocated data in a regular fashion (that is it will allocate sizeof(BookKeeping) + size more for each object, etc).

Such approach seems more natural from the memory management perspective then
having completely disjoint Allocator/Deallocator that are then united into
Policy.


http://chromiumcodereview.appspot.com/10448007/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to