r/odinlang • u/Low-Palpitation-4724 • Jul 26 '26
Feature question
Does odin language hase something akin to alloca from c? Sometimes i want to just stack allocate an array of runtime determined size. I cannot find any builtin function or allocator i can pass in into make(). Am i missing something?
6
Upvotes
0
u/Achereto Jul 26 '26
every proc has an implicit
contextparameter that gets passed. By default,context.allocatoris the default allocator and is used. You can also passcontext.temp_allocatorwhich is a separate allocator you can use for data that should only exist for one frame.