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?