annotate run/new_09.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents b3da1b510a19
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
378
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
1 // $HeadURL$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
2 // $Date$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
3 // $Auhthor$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
4
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
5 module dstress.run.new_09;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
6
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
7 int counter;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
8
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
9 class MyClass{
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
10 this(){
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
11 assert(counter==1);
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
12 counter+=2;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
13 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
14
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
15 new(size_t size){
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
16 assert(counter==0);
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
17 counter++;
889
b3da1b510a19 div. memory management
thomask
parents: 378
diff changeset
18 return (new byte[size]).ptr;
378
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
19 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
20 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
21
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
22 int main(){
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
23 MyClass c;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
24 assert(counter==0);
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
25 c = new MyClass();
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
26 assert(counter==3);
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
27 return 0;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
28 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
29