logoalt Hacker News

btownlast Wednesday at 8:08 PM1 replyview on HN

Hadn’t known about Odin but yes!

> Operations such as new, free and delete by default will use context.allocator, which can be overridden by the user. When an override happens all called procedures will inherit the new context and use the same allocator.

https://pkg.odin-lang.org/core/mem/


Replies

Zambytelast Thursday at 4:24 AM

This sounds a lot like having an allocator as a parameter object a la Scheme[0]. Really cool!

[0] https://standards.scheme.org/corrected-r7rs/r7rs-Z-H-6.html#...