| Re: C++ Memory Management Innovation: GC Allocator |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.c++.moderated · Group Profile
Author: xushiweixushiwei Date: Apr 30, 2008 02:20
"Chris Thomasson" comcast.net> wrote:
I have a suggestion about your region allocator: Use allocator
instances instead of global new/delete procedures.
I don't like to override the DEFAULT operator new/delete. This makes
your code doesn't work well together 3rdparty code (if it also
override them).
I suggest ISO C++ cancel this feature, just like we can't override
operator+ of all C types. That is:
1. You CAN NOT override these operators:
void* operator new(size_t size);
void operator delete(void* p);
2. You CAN override NON-DEFAULT operator new. Such as:
void* operator new(size_t size, my_allocator& alloc);
3. There is no need to override operator delete. If you need delete
objects in special way, just use:
alloc.destroy(obj);
|