Array allocations [was: Re: What does C++...]

bearophile bearophileHUGS at lycos.com
Sat Jul 30 12:45:54 PDT 2011


Don:

> Yeah, it's not fundamental, and not even very complicated. The current 
> implementation was a quick hack to provide the functionality, that 
> hasn't been replaced with a proper implementation yet. All that's 
> required to fix it is a bit of code in e2ir.c.

Thank you for your (positive) answer. Generally optimizations have a lower priority than nasty bugs. I use enough fixed-sized arrays in my D code (I think of it as a good practice I have learnt from reading Ada code, and sometimes I initialize them from literals. Ada programs are higher level than C but they use stack allocations most of the times. There are stack-allocated variable-size arrays too), so I'd like this optimization. Sometimes I use fixed-size arrays as keys of associative arrays, to remove one indirection level.

Bye,
bearophile


More information about the Digitalmars-d mailing list