6 ms·
Types are stack allocated by default. "var data: MyObject" is on the stack. "var arr: array[1000, MyObject]" is allocated on the stack sequentially. Only dyna
by arc619 3y ago
Types are stack allocated by default.
"var data: MyObject" is on the stack.
"var arr: array[1000, MyObject]" is allocated on the stack sequentially.
Only dynamic seq or ref types use the heap by default.
- pavlov 3y agoSo, same as C++.