logoalt Hacker News

ozgrakkurt • yesterday at 10:03 AM • 4 replies • view on HN

Good luck to all people who are going to try implementing allocators!

Last time I tried, even the standard containers were giving different layouts to allocate and deallocate.

Also as a bonus, you get to put another template parameter to all of your containers!


Replies

tialaramex • yesterday at 12:01 PM

> Last time I tried, even the standard containers were giving different layouts to allocate and deallocate.

Do you have some concrete examples? I couldn't reproduce this but maybe I'm looking in the wrong places.

➕ show 1 reply
lenkite • yesterday at 11:15 AM

Yet, in the lang adoption game, many who were looking at Zig thanks to native support for allocators will now re-look at Rust to solve their problem.

➕ show 1 reply
couchand • yesterday at 1:57 PM

> Last time I tried

For the benefit of the reader, this was two years ago.

The OP references updates made in Rust 1.100, released three weeks ago.

➕ show 1 reply
stingraycharles • yesterday at 12:27 PM

do those of us who come from a c++ background this all looks oddly familiar and equally painful

➕ show 1 reply