D on next-gen consoles and for game development

deadalnix deadalnix at gmail.com
Thu May 23 22:29:08 PDT 2013


On Friday, 24 May 2013 at 05:02:33 UTC, Manu wrote:
> On 24 May 2013 14:11, Marco Leise <Marco.Leise at gmx.de> wrote:
> I don't think it's hack-ish at all, that's precisely what the 
> stack is
> there for. It would be awesome for people to use alloca in 
> places that it
> makes sense.
> Especially in cases where the function is a leaf or leaf-stem 
> (ie, if there
> is no possibility of recursion), then using the stack should be 
> encouraged.
> For safety, obviously phobos should do something like:
>   void[] buffer = bytes < reasonable_anticipated_buffer_size ?
> alloca(bytes) : new void[bytes];
>

That is probably something that could be handled in the optimizer 
in many cases.


More information about the Digitalmars-d mailing list