view tests/mini/gc_datasegment.d @ 1297:8e8552601ecd

Stack promotion for _d_newarrayvT. Array literals, concatenations (a ~ b) and such are eligible for stack-allocation now.
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 03 May 2009 18:01:45 +0200
parents d159da5201f1
children
line wrap: on
line source

extern(C) void gc_collect();

class C
{
  int i = 42;
}

C data;

void main()
{
  data = new C;
  gc_collect();
  assert(data.i == 42);
}