Remix.run Logo
MangoToupe 4 hours ago

Odin claims to be pragmatic (what language doesn't lol) but "All procedures that returned allocated memory will require an explicit allocator to be passed". Charitably, is this aimed at c/zig heads?

BigJono 4 hours ago | parent | next [-]

I'm guessing it's aimed at game development since Vulkan has a similar pattern in every function call (although optional, the driver does it's own allocation if you pass null).

astrange 3 hours ago | parent [-]

That's a pretty heavyweight pattern. Wouldn't dynamic scope be better?

messe 3 hours ago | parent | prev | next [-]

> All procedures that returned allocated memory will require an explicit allocator to be passed

All procedures in core/os. Odin isn't removing the allocator from implicit context in the rest of its APIs.

ycombinatrix an hour ago | parent | prev | next [-]

How do you allocate memory without an allocator?

leecommamichael 3 hours ago | parent | prev [-]

All you've got to do is write `context.allocator` to abide.