deprecate "reallocate" in allocators

Phil Edwards phil@jaj.com
Wed Jun 26 11:06:00 GMT 2002


The SGI allocator classes have a "reallocate" member function.  Nonstandard,
we never use them anywhere (I checked), and I've never heard of people using
them, since they just wrap allocate/copy/deallocate.

It's been pointed out that if our operator new ever /stops/ using malloc,
or if a user happens to write a replacement operator new that doen't
use malloc, then the pool allocator's reallocate() will be broken, since
it calls realloc() directly, instead of going through __mem_interface.
(This is because __mem_interface points at __new_alloc, which doens't /have/
a reallocate function.)

So right now it happens to work, but is easily breakable.


I vote we deprecate the reallocate() functions for 3.2 as needless extensions,
and remove in 3.3.

Thoughts?


Phil
P.S.- I've been able to generalize the pool allocator enough to get rid
of __mem_interface, but I'm keeping __USE_MALLOC so far.  I don't want
to even propose a patch for 3.2; there's not nearly enough time to get
community testing and feedback.

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



More information about the Libstdc++ mailing list