TempAlloc review starts now

dsimcha dsimcha at yahoo.com
Sun Jun 5 16:12:26 PDT 2011


On 6/5/2011 6:50 PM, Andrej Mitrovic wrote:
> I wish "newVoid" was a language feature. If we have:
> int x = void;
>
> It'd also be nice to have a similar form for the new operator:
> int[] x = void new int[](size);
> x[] = 1;
>
> "int x = void" might not save too much cycles, but initializing a
> large array twice.. that's another thing.
>
> newVoid seems to only work for 1-dimensional arrays. I could use
> something of this form:
> double[][] arr = newVoid!(double[][])(16, 100);
>
> Not a big deal, I could write something like this for my own projects.
> I'm just commenting.
>
> I used GC.malloc before but I never once thought about setting the
> NO_SCAN flag. Heh. :)

newVoid will probably be renamed to something more verbose and explicit 
at Andrei's request.  See 
http://d.puremagic.com/issues/show_bug.cgi?id=3383 .  While I'm at it, I 
guess I could make it support multidimensional.


More information about the Digitalmars-d mailing list