3 ms·
Kind of. You can use a bump allocator like bumpalo[0], but any code that allocates needs to be aware of it (or it won't be able to take advantage of it). It als
by Nullabillity 5y ago
Kind of. You can use a bump allocator like bumpalo[0], but any code that allocates needs to be aware of it (or it won't be able to take advantage of it). It also needs to reinvent all collection types (bumpalo provides strings and vectors atm).
The plan is to parametrize all std collections on the allocator eventually, but that's not stable yet.
[0]: https://docs.rs/bumpalo/3.6.1/bumpalo/ https://docs.rs/bumpalo/3.6.1/bumpalo/
- amelius 5y agoHopefully this project could allow allocations inside memory-mapped files (which can then later be loaded at a different base address) in one quick load operation (instead of serializing everything).
- Eikon 5y agoOr you could just use jemallocator with background threads. https://crates.io/crates/jemalloc-sys https://crates.io/crates/jemalloc-sys "background_threads (disabled by default): enables background threads by default at run-time. When set to true, background threads are created on demand (the number of background threads will be no more than the number of CPUs or active arenas). Threads run periodically, and handle purging asynchronously. [...]"