4 ms·
> it'll call mmap (probably), which will then find 1GB(+ overhead) of contiguous address space It does. Last time I dug into that I think there was a 128KB thr
by dividuum 7y ago
> it'll call mmap (probably), which will then find 1GB(+ overhead) of contiguous address space
It does. Last time I dug into that I think there was a 128KB threshold. Smaller allocations would use sbrk while larger once would use mmap.
- saagarjha 7y agoThe limit is now dynamic on glibc: https://sourceware.org/glibc/wiki/MallocInternals#Malloc_Algorithm https://sourceware.org/glibc/wiki/MallocInternals#Malloc_Alg..., http://man7.org/linux/man-pages/man3/mallopt.3.html http://man7.org/linux/man-pages/man3/mallopt.3.html
- blattimwind 7y agosbrk also just modifies a mapping. All userspace memory management happens through mappings (to files, anonymous or perhaps I/O space).