3 ms·
why is that necessary in this case vs some other use of mmap?
by cat199 9y ago
why is that necessary in this case vs some other use of mmap?
- mcculley 9y agoIt allowed one to map the zero page to a region and then quickly swap it for another region. This benefited code that emulated 16-bit address spaces.
- cat199 9y agoso, it made the equivalent portable code easier to write, am I correct?
- mcculley 9y agoNo, if I remember correctly, there was no other way to do what I was doing without using some file on the filesystem as the chunk of memory to be swapped. Calling mmap() on /proc/self/mem allowed one to make a block of memory show up at the zero page and swap it with another with a single system call, instead of copying the block back and forth. It has been at least a decade since I touched that code, so I may be misremembering.