TempAlloc Overhaul
Jose Armando Garcia
jsancio at gmail.com
Fri Jun 17 09:50:54 PDT 2011
On Fri, Jun 17, 2011 at 11:12 AM, dsimcha <dsimcha at yahoo.com> wrote:
> On 6/16/2011 11:46 PM, Andrei Alexandrescu wrote:
>> * newArray -> "For performance reasons, the returned array is not
>> initialized." Then call it newUninitializedArray. Make safety the
>> default and lack thereof the verbose alternative.
>
> Here I'm going to have to strongly disagree with you. The whole point of
> TempAlloc is that it's a performance hack. In general I agree it's better
> to do the safe thing by default, but libraries specifically written as
> performance hacks are an exception. In TempAlloc it makes sense to do the
> efficient thing by default. I personally would never use newArray as
> opposed to newUninitializedArray and TempAlloc.newUninitializedArray (31
> characters) feels **ridiculously** verbose and would clutter the API.
Hmm. If this is a hack then what is it doing in the std library for
the language?!
More information about the Digitalmars-d
mailing list