The state of Rust allocators in 2026: stabilised (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
You kind of can do dynamically scoped variables (though the only way I know to do this itself uses a thread-local stack and doesn't play nice with async), but you wouldn't be able to rewrite e.g. Box::new to use it instead of the thing bound to the global allocator. You could, however, provide an implementation of a global allocator that resolves your dynamically-scoped allocator for each allocation.
Yeah you would pay for the overhead of a thread-local on every allocation. Rust nightly does at least support a faster version of TLS (#[thread_local]) instead of the thread_local! macro. Not ideal, but there would necessarily be _some_ overhead involved with any strategy for resolving a dynamically-bound Allocator impl at runtime instead of a static one.