3 ms·
Check out bumpalo[1]. Dodrio is a real-world[2] usage of bumpalo, so you can inspect that code to see how he deals with lifetimes correctly. Edit: GATs are how
by zamalek 6y ago
Check out bumpalo[1]. Dodrio is a real-world[2] usage of bumpalo, so you can inspect that code to see how he deals with lifetimes correctly.
Edit: GATs are how "placement new" (Rust doesn't have new at all, hence the airquotes) would work in Rust, assuming the author here meant to say "custom allocators." With GATs, you could create a pointer (Box, Arc, ArenaBox etc.) trait and use that on your message types.[3] "Placement new" is a whole different issue that ultimately boils down to a compiler optimization that is currently missing/not working and shouldn't functionally affect what you are trying to do at all.
[1]: https://github.com/fitzgen/bumpalo https://github.com/fitzgen/bumpalo
[2]: https://github.com/fitzgen/dodrio https://github.com/fitzgen/dodrio
[3]: https://rust-lang.github.io/rfcs/1598-generic_associated_types.html https://rust-lang.github.io/rfcs/1598-generic_associated_typ...