TempAlloc Overhaul

dsimcha dsimcha at yahoo.com
Sat Jun 11 09:26:54 PDT 2011


I've overhauled my TempAlloc proposal based on some of the suggestions 
I've received.  Here are the major changes:

1.  I've reconsidered and decided TempAlloc belongs in its own Phobos 
module (std.tempalloc) instead of in core.memory, mainly because it uses 
Phobos in ways that aren't easy to get rid of.

2.  Move uninitializedArray (formerly newVoid) to its own pull request 
for inclusion in std.array.  This keeps the TempAlloc proposal more 
tightly focused.

3.  Make alignedMalloc and friends private for now, again to make the 
proposal more tightly focused.

4.  Rename tempdup to tempArray to emphasize that is semantics are more 
similar to std.array.array than .dup w.r.t. narrow strings.

5.  Move newStack into the TempAlloc namespace and rename it 
TempAlloc.newArray.

6.  TempAlloc.newArray now handles multidimensional arrays.  Its syntax 
is slightly modified to accommodate this.  Before:

double[] foo = newStack!double(100);

After:

double[] foo = TempAlloc.newArray!(double[])(100);

Code:

https://github.com/dsimcha/TempAlloc

Docs (NOT the same as the old URL):

http://cis.jhu.edu/~dsimcha/d/phobos/std_tempalloc.html


More information about the Digitalmars-d mailing list