Hacker News new | ask | show | jobs
by arc619 1051 days 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.

1 comments

So, same as C++.