Source

Branch

1/ @SergeyLerg

@SebAaltonen

I like how Jai solved this. You can return dynamically allocated data just fine because every function has access to a temporary allocator (linear block of reserved heap memory). Most data is short lived and the temporary storage is cleaned at e.g. the end of a game render frame

2/ @SebAaltonen

@SergeyLerg

Yes. That’s how C/C++ based game engines tend to do it as well. You just use linear temp allocator (reset at end of frame). But a stack based temp allocator would be even better here. Even better if integrated to the language. Would be easy to use = would be the default for all.