Hacker News
points by OskarS 4 days ago | 0 comments
I don't agree. Zig allocators require the size of the allocation (technically they take a slice, but a slice is ptr + size), as does the C++ polymorphic allocator, as does many allocator interfaces in many libraries (see for instance the allocator interface in Lua, my personal favorite C interface for memory allocation [0]). Clearly having it as a correctness requirement works just fine.

[0]: https://www.lua.org/manual/5.4/manual.html#lua_Alloc

[–] 0xdeafbeef 4 days ago
https://github.com/microsoft/mimalloc/issues/1423 https://github.com/microsoft/mimalloc/issues/1400

And there also bugs for zig. So hint - fine. Trust it? Not sure. Every allocator is different and can be swapped

Hacker News