Mercurial > projects > dstress
annotate run/new_06.d @ 889:b3da1b510a19
div. memory management
author | thomask |
---|---|
date | Mon, 06 Mar 2006 08:01:27 +0000 |
parents | e555e1460d7e |
children |
rev | line source |
---|---|
378 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.new_06; | |
6 | |
7 int counter; | |
8 | |
9 class MyClass{ | |
10 new(size_t size){ | |
11 counter++; | |
889 | 12 return (new byte[size]).ptr; |
378 | 13 } |
14 } | |
15 | |
16 int main(){ | |
17 assert(counter==0); | |
18 MyClass c = new MyClass(); | |
19 assert(counter==1); | |
20 return 0; | |
21 } |