Rune - Content-locking work 1/2
[rune.git] / tests / nozero.d
1 #!/usr/local/bin/rune -x
2 #
3 #       Test sizeof(), arysize(), and typeof().
4
5 limport "sys";
6 import "stdio";
7
8 int
9 main(int ac, char **av)
10 {
11         int i;
12
13         # Time with getfreebuffer1(), getfreebuffer2(), and getfreebuffer3().
14         #
15         stdio.stdout->show("time this nozero loop");
16         for (i = 0; i < 5000000; ++i) {
17                 getfreebuffer3();
18         }
19         return(0);
20 }
21
22 void
23 getfreebuffer1()
24 {
25         heap __nozero char buf[32760];
26 }
27
28 void
29 getfreebuffer2()
30 {
31         char *buf;
32
33         buf.new(32760);
34         buf = NULL;
35 }
36
37 void
38 getfreebuffer3()
39 {
40         char buf[32760];
41
42 }