slow runtime

Pelle pelle.mansson at gmail.com
Fri Sep 10 04:15:10 PDT 2010


On 09/10/2010 10:17 AM, Jonathan M Davis wrote:
> On Friday 10 September 2010 00:50:32 bearophile wrote:
>> Jonathan M Davis:
>>> Aren't they _always_ on the heap?
>>
>> void main() {
>>      int[10] a;
>>      int[] b = a[];
>> }
>>
>> Bye,
>> bearophile
>
> Ah, good point. When you have a slice of a static array as opposed to a dynamic
> arra allocated with new, then it's on the stack. Since I pretty much never use
> static arrays, I forgot about that.
>
> - Jonathan M Davis

int i;
int[] heh = (&i)[0..1];


More information about the Digitalmars-d-learn mailing list