RFC: moving forward with @nogc Phobos

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 30 05:31:15 PDT 2014


On 9/30/14, 3:47 AM, Vladimir Panteleev wrote:
> On Tuesday, 30 September 2014 at 08:34:26 UTC, Johannes Pfau wrote:
>> What if I don't want automated memory _management_? What if I want a
>> function to use a stack buffer? Or if I want to free manually?
>>
>> If I want std.string.toStringz to put the result into a temporary stack
>> buffer your solution doesn't help at all. Passing an ouput range,
>> allocator or buffer would all solve this.
>
> I don't understand, why wouldn't you be able to temporarily set the
> thread-local allocator to use the stack buffer, and restore it once done?

That's doable, but you don't get to place the string at a _specific_ 
buffer. -- Andrei


More information about the Digitalmars-d mailing list