logoalt Hacker News

MangoToupetoday at 6:48 AM4 repliesview on HN

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?


Replies

messetoday at 7:35 AM

> 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.

BigJonotoday at 6:51 AM

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).

show 1 reply
ycombinatrixtoday at 9:36 AM

How do you allocate memory without an allocator?

show 1 reply
leecommamichaeltoday at 7:37 AM

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