Thread overview
suppression of default initilisation
Nov 07, 2011
Steven Kucera
Nov 07, 2011
Steven Kucera
November 07, 2011
Hello world,

I started to use D on a pet project, and excited that it seems to match C++ in speed.

I have a heavily called recursive function, each puts a fix sized array on the stack. The call to memset to init the array slows things down.

Is there any way to suppress the automatic initialisation, or might there be in the future, as the optimisation switches don't seem to change it.

Regards,
Steve Kucera
November 07, 2011
On 07-11-2011 11:43, Steven Kucera wrote:
> Hello world,
>
> I started to use D on a pet project, and excited that it seems to match C++ in
> speed.
>
> I have a heavily called recursive function, each puts a fix sized array on the
> stack. The call to memset to init the array slows things down.
>
> Is there any way to suppress the automatic initialisation, or might there be
> in the future, as the optimisation switches don't seem to change it.
>
> Regards,
> Steve Kucera

Initialize it to void, e.g.: int[1024] foo = void;

- Alex
November 07, 2011
Hi,

> > Regards,
> > Steve Kucera
> Initialize it to void, e.g.: int[1024] foo = void;
> - Alex

Brilliant! Thanks
Steve