Mercurial > projects > dstress
annotate run/new_12.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | b3da1b510a19 |
children |
rev | line source |
---|---|
378 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.new_12; | |
6 | |
7 int counter; | |
8 | |
9 struct MyStruct{ | |
10 int x; | |
11 | |
12 new(size_t size){ | |
13 counter++; | |
889 | 14 return (new byte[size]).ptr; |
378 | 15 } |
16 } | |
17 | |
18 int main(){ | |
19 assert(counter==0); | |
528 | 20 MyStruct* m=new MyStruct; |
378 | 21 m.x=1; |
22 assert(counter==1); | |
23 return 0; | |
24 } | |
25 |