using mmap on large (> 2 Gig) files

sturlamolden sturlamolden at
Tue Oct 24 23:52:49 CEST 2006

Fredrik Lundh wrote:

> > to large to fit in a 32 address space. Thus, mmapmodule.c needs to be
> > fixed before it can be used for large files.
> if you've gotten that far, maybe you could come up with a patch, instead
> of stating that someone else "needs to fix it" ?

I did not say "someone else" needs to fix it. I can patch it, but I am
busy until next weekend. This is a typical job for a cold, rainy
Saturday afternoon. Also I am not in a hurry to patch mmapmodule.c for
my own projects, as I am not using it (but I am going to).

A patch would involve an new object, say, "mmap.mmap2"  that thakes the
additional offeset parameter. I don't want it to break any code
dependent on the existing "mmap.mmap" object. Also, I think mmap.mmap2
should allow the file object to be None, and in that case return a
shared memory segment backed by the OS' paging file. Calling
CreateFileMapping with the filehandle set to INVALID_HANDLE_VALUE is
how shared memory for IPC is created on Windows.

More information about the Python-list mailing list