News for hackers. Stuff that matters.
Re:Allocators in Rust by azakai on Saturday November 15, 2014 @05:30PM (#8612835)
> Rust uses jemalloc for the same reasons; there's just no technical reason not to use it.

If so, I wonder if this is true for every language, then? For example, for C++, should gcc and clang emit binaries with jemalloc linked in?

Re:Allocators in Rust by nteon on Saturday November 15, 2014 @05:37PM (#8612845)
no - its not the job of the compiler to choose your memory allocator. There is talk, however, of replacing the current glibc allocator with jemalloc[1], which is the more appropriate place for that decision to be made.

1 - https://sourceware.org/ml/libc-alpha/2014-10/msg00419.html

Re:Allocators in Rust by derefr on Saturday November 15, 2014 @11:49PM (#8613456)
To me, it seems like the most sensible thing would be to make the choice of memory allocator a global OS configuration parameter—like enabling DEP on Windows. It'd still only be the program (or language runtime) deciding for itself whether to obey the allocator suggestion—but having one system-level place for this kind of policy information to be stored, where glibc et al could look for it, would make a lot more sense.
Re:Allocators in Rust by db48x on Sunday November 16, 2014 @12:49AM (#8613550)
No thanks; that'd be worse. Then you'd have to test every release of your program with every allocator in combination with every other configuration change that could be made.

Besides, different applications work best with different allocators so it's definitely a choice the author of a program needs to make.

Re:Allocators in Rust by shmerl on Saturday November 15, 2014 @08:30PM (#8613183)
FreeBSD uses jemalloc by default in its libc. But it's not compiler's decision.