std.stringbuffer

Janice Caron caron800 at googlemail.com
Wed Apr 30 00:37:52 PDT 2008


2008/4/30 Sean Kelly <sean at invisibleduck.org>:
>  Tango even exposes
>  a GC.realloc() routine which will do this for you.

So does Phobos. std.gc.realloc().

However, realloc() doesn't promise not to copy, and not copying is the
objective. Thanks for all the cool info, but I just think programmers
would just feel more "comfortable" if, after they've done all their
in-place string manipulations, they can call some minimizing function,
even if only to give them a warm fuzzy feeling that they're not
wasting any more memory than is necessary.

Frankly, it could even be implemented a do-nothing function. That way,
at least "blame" for excessive memory use passes from the programmer
to Phobos, and future gc implementations might do things differently.



More information about the Digitalmars-d mailing list