Variable-length stack allocated arrays

bearophile bearophileHUGS at lycos.com
Tue Jan 12 07:21:23 PST 2010


Lars T. Kyllingstad:
>    struct CustomTempAlloc(uint blockSize)
>    { // current TempAlloc code here }
> 
>    
>    alias CustomTempAlloc!(4U * 1024U * 1024U) TempAlloc;

Or:

struct TempAlloc(uint blockSize=4U * 1024U * 1024U) {
    // Default is 4MB
    // current TempAlloc code here }

Bye,
bearophile



More information about the Digitalmars-d mailing list