3 ms·
I don't, and I also haven't learned Rust. My experience with arena allocators comes from Bloomberg's C++ libraries[1]. For example, here's the documentation[2]
by MathMonkeyMan 2y ago
I don't, and I also haven't learned Rust.
My experience with arena allocators comes from Bloomberg's C++ libraries[1].
For example, here's the documentation[2] for a thread safe heterogeneous allocator and header[3] for the underlying thread safe pool.
It uses a mutex, but at a glance only when it needs to consult the fallback allocator (which could involve a system call). If you knew that the fallback allocator were a pre-allocated arena, maybe you could do with atomics only. The free list is already lock-free, and so too could be the block list.
[1]: https://github.com/bloomberg/bde/wiki/BDE-Allocator-model https://github.com/bloomberg/bde/wiki/BDE-Allocator-model
[2]: https://bloomberg.github.io/bde-resources/doxygen/bde_api_prod/group__bdlma__concurrentmultipool.html https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...
[3]: https://bloomberg.github.io/bde-resources/doxygen/bde_api_prod/bdlma__concurrentpool_8h_source.html https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...