Thread overview | |||||
---|---|---|---|---|---|
|
November 07, 2011 suppression of default initilisation | ||||
---|---|---|---|---|
| ||||
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 Re: suppression of default initilisation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Kucera | 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 Re: suppression of default initilisation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex Rønne Petersen | Hi,
> > Regards,
> > Steve Kucera
> Initialize it to void, e.g.: int[1024] foo = void;
> - Alex
Brilliant! Thanks
Steve
|
Copyright © 1999-2021 by the D Language Foundation