run-time stack-based allocation

Arne arne at linux.nu
Mon May 7 14:20:28 PDT 2012


On Monday, 7 May 2012 at 20:20:34 UTC, Mehrdad wrote:
> On Monday, 7 May 2012 at 16:52:18 UTC, Arne wrote:
>>> I think you'd need to modify the compiler for this, since 
>>> alloca is 'magical'.
>>
>> wouldn't mixin's be a solution, one can inject an alloca to 
>> the current scope, and then call the constructor...
>
> Yeah, but mixins are so hacky.
> They're like C macros, basically.

/rant

Well, I think if the world had never seen all the bad
side-effects from 'C macros', most people would wholeheartedly
embrace mixin's today... since it cleanly avoids 'x' number of
design pitfalls from #define.

For maintenance, performance, portability considerations I
definitely prefer mixin's over reimplementing alloca for every
current and future targets/calling conventions.



More information about the Digitalmars-d mailing list