[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.10,2.11

Trent Mick trentm@activestate.com
Sat, 17 Jun 2000 20:20:09 -0700


On Sun, Jun 18, 2000 at 02:50:51AM +0200, Vladimir Marangozov wrote:
> 
> A.M. Kuchling wrote:
> >
> > Update of /cvsroot/python/python/dist/src/Modules
> > In directory slayer.i.sourceforge.net:/tmp/cvs-serv2060
> >
> > Modified Files:
> >       mmapmodule.c
> > Log Message:
> > Fix the size() method to return the size of the file on Unix, not the
> > size of the mapped area.  This seems to be what the Windows version does.
> > This change requires keeping around the fd of the mapped file.
> 
> On AIX, the test_mmap fails with errno=EINVAL on the m.flush() method.
> It works okay without the MS_INVALIDATE flag though, so I'd suggest
> removing it from msync in the flush and dealloc methods.
> 
> Also, it would probably be a good idea to allow optional flags for
> flush, as it's done in new_mmap_object, the default being only MS_SYNC.
> 
> Given that this module is enabled by default, I think that it needs some
> more stress-testing in test_mmap.py. I'll try to add a couple of tests
> shortly.
> 

Just to add to the mmap fray. The seek() method is broken for any 'whence'
value (seek from start, current, orend) other than the default. Ihave a patch
that fixes that as well as gets mmap'd files working on Linux64 and Win64.
The test_mmap was also extended. The patch is up on SourceForge for your
perusal. :)

https://sourceforge.net/patch/?func=detailpatch&patch_id=100515&group_id=5470

Cheers,
Trent

-- 
Trent Mick
trentm@activestate.com