3 ms·
In the corner of rust I have experience in (web servers, ffi for cli's) you just use the system allocator. I know it's not that hard to switch that default allo
by iudqnolq 5y ago
In the corner of rust I have experience in (web servers, ffi for cli's) you just use the system allocator. I know it's not that hard to switch that default allocator to something like jemalloc, but I've never needed to do that. Rust is currently refactoring the standard library to be genetic over the allocator like c++ so you you can have two vectors with different allocators, but I don't really understand the point outside of stuff like kernel development.
- paulfurtado 5y agoThere are a lot of low level algorithms that benefit from custom allocators which allow them to take advantage of SIMD instructions. Haven't used rust in a long time, but back in school I called out to the c++ fftw library from rust, which wants its own allocator to be used for this purpose. That said, at least at that point in time (or due to my naivety) it was rather straightforward to hook up: https://github.com/PaulFurtado/rusty_bars/blob/master/src/fftw/aligned_array.rs https://github.com/PaulFurtado/rusty_bars/blob/master/src/ff... That code looks like it just handled arrays, but I recall having implemented Vec at some point but I guess I probably removed it from the final code