Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>mmap can easily handle files larger than RAM/swap. What mmap can't do is handle files larger than the address space, which means that 32bit systems are limited in how large a file they can use. </p> <p>What happens with <code>mmap</code> is that the OS will only have in memory as much data as it it chooses to, but you program will think it is all there. Be careful in usage patters though since if your data DOESN'T fit in RAM and you jump around too randomly, it will swap (discard pages from your file that you haven't used recently to make room for the new pages to be loaded).</p> <p>If you don't need to specify anything base <code>fileno</code> and <code>length</code>, I don't believe you need to worry about the platform specific arguments for <code>mmap</code>. If you do need to worry about the extra arguments, then you will either have to master Windows versus Unix, or pass that on to your users. I don't know what your library will be, but it may be nice to provide reasonable defaults on both platforms while also allowing the user to tweak the options. It looks to me that it would be unlikely that you would care about the Windows <code>tagname</code> option, also, if you are cross platform, then just accept the Unix default for <code>prot</code> since you have no choice on Windows. That only leaves caring about <code>MAP_PRIVATE</code> and <code>MAP_SHARED</code>. The default is <code>MAP_SHARED</code>, but I'm not sure if that is the option that most closely matches Windows behavior, but accepting the default is probably fine there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload