2 ms·
The rust compiler makes use of custom arenas for allocation, quite heavily in fact. And does it without using the nightly-only custom allocator alloc types. Ins
by est31 4y ago
The rust compiler makes use of custom arenas for allocation, quite heavily in fact. And does it without using the nightly-only custom allocator alloc types. Instead, there are functions that let you build structures inside the arena, plus a bunch of macro logic that builds on it. And while rustc generally uses a lot of nightly features, there is nothing fundamental about it that requires nightly.
Also, again, it's a fair concern that you want to be doing custom allocators, but this is not the same as claiming that no-std applications can't use the heap at all, which is what the blog post did. For simple heap usage, a global allocator is enough.