On Friday, 7 February 2014 at 08:24:39 UTC, Walter Bright wrote:
https://github.com/D-Programming-Language/phobos/pull/1911

This adds a package std.buffer, and the first entry in that package, std.buffer.scopebuffer.

ScopeBuffer is an OutputRange that sits on the stack, and overflows to malloc/free. It's designed to help in eliminating gc allocation by lower level functions that return buffers, such as std.path.buildPath(). With some judicious user tuning of the initial stack size, it can virtually eliminate storage allocation.

Using it is @system, but the user of ScopeBuffer can be @trusted.

An output range like this is a precursor to eliminating the excessive gc use by functions such as buildPath().

Wasn't there a simple composed Allocator from std.allocator that did exactly this? Composing InSituAllocator with Mallocator through FallbackAllocator or something.

Reply via email to