4 ms·
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
by nteon 12y ago
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 https://sourceware.org/ml/libc-alpha/2014-10/msg00419.html
- derefr 12y agoTo 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.
- db48x 12y agoNo 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.