Last change
on this file since 062467b was
cfbc56ec,
checked in by Michael Brooks <mlbrooks@…>, 10 months ago
|
Enable array RAII and provide uninit(-), a uNoCtor equivalent.
Enable construction/destruction of "new" CFA array elements,
which was previously deactivated to avoid a compiler performance issue.
The enabled RAII steps more carefully around the performance issue.
Provide uninit(-), with tests covering the typical use case:
struct Foo;
void ?{}( Foo & this, int i ) { printf( "ctor at %d\n", i ); }
uninit(Foo) a[10]; no prints
for (i; 10) (a[i]){ i }; prints
array(uninit(Foo), 10) b; no prints
for (i; 10) (b[i]){ i }; prints
|
-
Property mode set to
100644
|
File size:
964 bytes
|
Line | |
---|
1 | === builtins |
---|
2 | some nonzero |
---|
3 | silly: some nonzero |
---|
4 | === custom |
---|
5 | [1] |
---|
6 | ctor 0 |
---|
7 | ctor 1 |
---|
8 | ctor 2 |
---|
9 | ctor 3 |
---|
10 | ctor 4 |
---|
11 | func 0 |
---|
12 | func 1 |
---|
13 | func 2 |
---|
14 | func 3 |
---|
15 | func 4 |
---|
16 | dtor 4 |
---|
17 | dtor 3 |
---|
18 | dtor 2 |
---|
19 | dtor 1 |
---|
20 | dtor 0 |
---|
21 | [2] |
---|
22 | ctor 0 |
---|
23 | ctor 1 |
---|
24 | ctor 2 |
---|
25 | ctor 3 |
---|
26 | ctor 4 |
---|
27 | ctor 5 |
---|
28 | func 0 at (0, 0) |
---|
29 | func 1 at (0, 1) |
---|
30 | func 2 at (0, 2) |
---|
31 | func 3 at (1, 0) |
---|
32 | func 4 at (1, 1) |
---|
33 | func 5 at (1, 2) |
---|
34 | dtor 5 |
---|
35 | dtor 4 |
---|
36 | dtor 3 |
---|
37 | dtor 2 |
---|
38 | dtor 1 |
---|
39 | dtor 0 |
---|
40 | [3] |
---|
41 | ctor 0 |
---|
42 | ctor 1 |
---|
43 | ctor 2 |
---|
44 | ctor 3 |
---|
45 | ctor 4 |
---|
46 | func 0 |
---|
47 | func 1 |
---|
48 | func 2 |
---|
49 | func 3 |
---|
50 | func 4 |
---|
51 | dtor 4 |
---|
52 | dtor 3 |
---|
53 | dtor 2 |
---|
54 | dtor 1 |
---|
55 | dtor 0 |
---|
56 | [4] |
---|
57 | ctor 0 |
---|
58 | ctor 1 |
---|
59 | ctor 2 |
---|
60 | ctor 3 |
---|
61 | ctor 4 |
---|
62 | func 0 |
---|
63 | func 1 |
---|
64 | func 2 |
---|
65 | func 3 |
---|
66 | func 4 |
---|
67 | dtor 4 |
---|
68 | dtor 3 |
---|
69 | dtor 2 |
---|
70 | dtor 1 |
---|
71 | dtor 0 |
---|
72 | === uninit |
---|
73 | [1] |
---|
74 | before ctors |
---|
75 | ctor 0 |
---|
76 | ctor 999 |
---|
77 | ctor 888 |
---|
78 | ctor 3 |
---|
79 | ctor 4 |
---|
80 | func 0 |
---|
81 | func 999 |
---|
82 | func 888 |
---|
83 | func 3 |
---|
84 | func 4 |
---|
85 | dtor 4 |
---|
86 | dtor 3 |
---|
87 | dtor 888 |
---|
88 | dtor 999 |
---|
89 | dtor 0 |
---|
90 | [2] |
---|
91 | before ctors |
---|
92 | ctor 100 |
---|
93 | ctor 101 |
---|
94 | ctor 102 |
---|
95 | ctor 110 |
---|
96 | ctor 999 |
---|
97 | ctor 888 |
---|
98 | func 100 at (0, 0) |
---|
99 | func 101 at (0, 1) |
---|
100 | func 102 at (0, 2) |
---|
101 | func 110 at (1, 0) |
---|
102 | func 999 at (1, 1) |
---|
103 | func 888 at (1, 2) |
---|
104 | dtor 888 |
---|
105 | dtor 999 |
---|
106 | dtor 110 |
---|
107 | dtor 102 |
---|
108 | dtor 101 |
---|
109 | dtor 100 |
---|
Note: See
TracBrowser
for help on using the repository browser.