www.digitalmars.com         C & C++   DMDScript  

D - suppression of default initilisation

reply Steven Kucera <stevenkucera gmail.com> writes:
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
Nov 07 2011
parent reply =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <xtzgzorex gmail.com> writes:
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
Nov 07 2011
parent Steven Kucera <stevenkucera gmail.com> writes:
Hi,

 Regards,
 Steve Kucera
Initialize it to void, e.g.: int[1024] foo = void; - Alex
Brilliant! Thanks Steve
Nov 07 2011