comparison run/align_09.d @ 1559:ec5e144583ea

D1 -> D2 : 1/N
author thomask
date Sun, 19 Aug 2007 19:11:54 +0000
parents b8c0195059d9
children
comparison
equal deleted inserted replaced
1558:d40d75fcd5c5 1559:ec5e144583ea
4 4
5 // @author@ Ben Hinkle <bhinkle@mathworks.com> 5 // @author@ Ben Hinkle <bhinkle@mathworks.com>
6 // @date@ 2005-03-23 6 // @date@ 2005-03-23
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3313 7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3313
8 8
9 // @WARNING@ imports Phobos' gc
10
11 module dstress.run.align_09; 9 module dstress.run.align_09;
12 10
13 import std.gc; 11 version(Tango){
12 static assert(0, "DSTRESS{XFAIL}: Tango doesn't provide access to fullCollect");
13 }else{
14 // @WARNING@ imports Phobos' gc
15 import std.gc;
14 16
15 struct S{ 17 struct S{
16 char[] font_face; 18 char[] font_face;
17 byte charset; 19 byte charset;
18 }
19
20 int main(){
21 S[] x;
22
23 for (int i=0;i<3;i++) {
24 S s;
25 s.font_face="font face".dup;
26 x ~= s;
27 } 20 }
28 21
29 fullCollect(); 22 int main(){
23 S[] x;
30 24
31 assert(x[0].font_face=="font face"); 25 for (int i=0;i<3;i++) {
32 assert(x[1].font_face=="font face"); 26 S s;
27 s.font_face="font face".dup;
28 x ~= s;
29 }
33 30
34 return 0; 31 fullCollect();
32
33 assert(x[0].font_face=="font face");
34 assert(x[1].font_face=="font face");
35
36 return 0;
37 }
35 } 38 }