Why is mmap
buffer allocation activated by default on cygwin, freebsd and irix6-5 but not on linux?
See USE_MMAP_FOR_BUFFERS
in emacs/src/config.h
.
and use_mmap_for_buffers
in emacs/configure.in
.
Isn't mmap
based access superior to normal buffer allocation?
The default glibc malloc() uses mmap for large allocations; From the malloc(3) manpage. "When allocating blocks of memory larger than MMAP_THRESHOLD bytes, the glibc malloc() implementation allocates the memory as a private anonymous mapping using mmap(2). MMAP_THRESHOLD is 128 kB by default, but is adjustable using mallopt(3)."
Perhaps switching to mmap on those other platforms is to work around poor malloc() implementations that don't do it themselves?
mmap() allocation is easier to realize in a threadsafe fashion, but brk() allocation is about 10% slower on Linux. See this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With