News for hackers. Stuff that matters.
Re:Leveraging Zig's Allocators by jerf on Saturday June 15, 2024 @12:44PM (#40690861)
Have you looked at how Erlang does memory management within its processes? You definitely can "get away" with a lot of things when you have actors you can reasonably expect will be small scale, if you are absolutely sure their data dies with them.
Re:Leveraging Zig's Allocators by sph on Sunday June 16, 2024 @06:38AM (#40696050)
The trick to Erlang's memory management is that data is immutable and never shared, so all the complication and contention around GC and atomic locks just disappear.
Re:Leveraging Zig's Allocators by mst on Sunday June 16, 2024 @07:49AM (#40696367)
The key thing (as I understand it) is that each process naturally has a relatively small private set of data, so Erlang can use a stop-the-process semispace copying collection strategy and it's fast enough to work out fine.

Since nothing can be writing to it during that anyway, I'm not sure the language level immutability makes a lot of difference to GC itself.