3 ms·
It would be possible to get small capacities from malloc and then switch to mmap once the capacity has grown to page size and try to extend the mapping with MAP
by mike_hock 3y ago
It would be possible to get small capacities from malloc and then switch to mmap once the capacity has grown to page size and try to extend the mapping with MAP_FIXED_NOREPLACE. The downside is that if the mapping can't be contiguously extended, it's a wasted syscall, but I can't imagine that it wouldn't be worth it in a 48-bit "64-bit" address space.