Hacker News new | ask | show | jobs
by dnautics 29 days ago
a lot of heavy duty systems have multiple allocator systems. the erlang virtual machine has 12:

https://www.erlang.org/docs/25/man/erts_alloc.html

jvm has at least 5:

https://github.com/openjdk/jdk/blob/master/src/hotspot/share...

postgres has at least 8:

https://github.com/postgres/postgres/blob/master/src/backend...

since zig anoints an allocator interface in its stdlib, your (and the stdlib's) data structures which use allocators can be trivially reused across different allocation strategies without rewriting code; and very likely (not guaranteed ofc) if you bring in someone else's code they will cleave to convention.

2 comments

Just yesterday I was thinking about the BEAM and would it be tidier if it were written in Zig.
JVM has surely more than 5, because the ecosystem enjoys multiple implementations.