logoalt Hacker News

Panzerschrektoday at 2:03 PM1 replyview on HN

Such things should be solved in more nice way, not by manually checking every allocation. Like via lightweight threads, with each of them having their own memory and a scheduler, which kills threads exceeding their memory limit.


Replies

ozgrakkurttoday at 3:17 PM

This compilicates things more compared to functions returning Result<>.

You also get locality benefits from bump style allocators. And you don't need SmallVec or similar optimization containers. And you also avoid mental overhead of managing many allocations in your head (or using a language with borrow checking).

show 1 reply