@@ -89,72 +89,71 @@ void loop() {
89
89
}
90
90
91
91
// ////////////////////////////
92
- #if 0
93
-
94
- Result with:
95
- Exceptions: Legacy(new can return nullptr)
96
-
97
- //////////////////////////////
98
-
99
- arduino_new benefits
100
-
101
- ---- - arduino_new:
102
- SomeClass@0x3fff1864()()
103
- ~ SomeClass @0x3fff1864
104
-
105
- ---- - arduino_new with oom:
106
- nullptr: 0
107
-
108
- ---- - arduino_new with constructor parameters:
109
- SomeClass@0x3fff1864(param1)(param2)
110
- ~ SomeClass @0x3fff1864
111
-
112
- ---- - arduino_newarray[2]
113
- SomeClass@0x3fff1868()()
114
- SomeClass@0x3fff1869()()
115
- @: 0x3fff1868 s = 1 s(2) = 2
116
- 0: 0x3fff1868
117
- 1: 0x3fff1869
118
- ~ SomeClass @0x3fff1869
119
- ~ SomeClass @0x3fff1868
120
-
121
- ---- - arduino_newarray[2](with constructor parameters)
122
- SomeClass@0x3fff1868(param1)()
123
- SomeClass@0x3fff1869(param1)()
124
- @: 0x3fff1868 s = 1 s(2) = 2
125
- 0: 0x3fff1868
126
- 1: 0x3fff1869
127
- ~ SomeClass @0x3fff1869
128
- ~ SomeClass @0x3fff1868
129
-
130
- ---- - arduino_newarray[100000]
131
- @: 0
132
-
133
- ---- - new
134
- SomeClass@0x3fff1864()()
135
- ~ SomeClass @0x3fff1864
136
-
137
- ----- new with oom: (abort() with option 'Exceptions: Disabled (new can abort)'
138
- this constructor should not be called
139
- nullptr: 0
140
-
141
- ---- - new[2]
142
- SomeClass@0x3fff1868()()
143
- SomeClass@0x3fff1869()()
144
- @:0x3fff1868 s = 1 s(2) = 2
145
- 0: 0x3fff1868
146
- 1: 0x3fff1869
147
- ~ SomeClass @0x3fff1869
148
- ~ SomeClass @0x3fff1868
149
-
150
- ---- - new[10000](badly fails with 'Exceptions: Legacy' or '...Disabled'
151
-
152
- Exception(29):
153
- epc1 = 0x402013de epc2 = 0x00000000 epc3 = 0x00000000 excvaddr = 0x00000000 depc = 0x00000000
154
-
155
- >>> stack >>>
156
-
157
- ...
158
- //////////////////////////////
159
-
160
- #endif
92
+ /*
93
+
94
+ Result with:
95
+ Exceptions: Legacy(new can return nullptr)
96
+
97
+ //////////////////////////////
98
+
99
+ arduino_new benefits
100
+
101
+ ----- arduino_new:
102
+ SomeClass@0x3fff1864()()
103
+ ~ SomeClass @0x3fff1864
104
+
105
+ ----- arduino_new with oom:
106
+ nullptr: 0
107
+
108
+ ----- arduino_new with constructor parameters:
109
+ SomeClass@0x3fff1864(param1)(param2)
110
+ ~ SomeClass @0x3fff1864
111
+
112
+ ----- arduino_newarray[2]
113
+ SomeClass@0x3fff1868()()
114
+ SomeClass@0x3fff1869()()
115
+ @: 0x3fff1868 s = 1 s(2) = 2
116
+ 0: 0x3fff1868
117
+ 1: 0x3fff1869
118
+ ~ SomeClass @0x3fff1869
119
+ ~ SomeClass @0x3fff1868
120
+
121
+ ----- arduino_newarray[2](with constructor parameters)
122
+ SomeClass@0x3fff1868(param1)()
123
+ SomeClass@0x3fff1869(param1)()
124
+ @: 0x3fff1868 s = 1 s(2) = 2
125
+ 0: 0x3fff1868
126
+ 1: 0x3fff1869
127
+ ~ SomeClass @0x3fff1869
128
+ ~ SomeClass @0x3fff1868
129
+
130
+ ----- arduino_newarray[100000]
131
+ @: 0
132
+
133
+ ----- new
134
+ SomeClass@0x3fff1864()()
135
+ ~ SomeClass @0x3fff1864
136
+
137
+ ----- new with oom: (abort() with option 'Exceptions: Disabled (new can abort)'
138
+ this constructor should not be called
139
+ nullptr: 0
140
+
141
+ ----- new[2]
142
+ SomeClass@0x3fff1868()()
143
+ SomeClass@0x3fff1869()()
144
+ @:0x3fff1868 s = 1 s(2) = 2
145
+ 0: 0x3fff1868
146
+ 1: 0x3fff1869
147
+ ~ SomeClass @0x3fff1869
148
+ ~ SomeClass @0x3fff1868
149
+
150
+ ----- new[10000](badly fails with 'Exceptions: Legacy' or '...Disabled'
151
+
152
+ Exception(29):
153
+ epc1 = 0x402013de epc2 = 0x00000000 epc3 = 0x00000000 excvaddr = 0x00000000 depc = 0x00000000
154
+
155
+ >>> stack >>>
156
+ ...
157
+
158
+ */
159
+ // ///////////////////////////
0 commit comments