[Patches] [ python-Patches-477161 ] New "access" keyword for mmap

noreply@sourceforge.net noreply@sourceforge.net
Tue, 13 Nov 2001 12:01:19 -0800


Patches item #477161, was opened at 2001-11-01 07:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=477161&group_id=5470

Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jay T Miller (jaytmiller)
>Assigned to: Tim Peters (tim_one)
>Summary: New "access" keyword for mmap

Initial Comment:
The attached patch adds a new keyword parameter to mmap
which provides a platform independent way of asking for
3 basic kinds of mmaps:   readonly, write-through, and
copy-on-write.  For now, platform independent means
UNIX and Win32.

A readonly mmap creates a true readonly section of the
process memory map, but python level access is guarded
so that attempts to write the section (or fetch a
writeable buffer) raise a ValueError exception.  A
readonly mmap is not resizeable.

A write-through memory map is both readable and
writeable, and updates to the memory are reflected onto
the underlying file.

A copy-on-write memory map is both readable and
writeable, but updates to the memory are *not*
reflected on the underlying file.  A copy-on-write mmap
is not resizeable.

The patch modifies mmapodule.c,  libmmap.tex, and
test_mmap.py.



----------------------------------------------------------------------

>Comment By: Barry Warsaw (bwarsaw)
Date: 2001-11-13 12:01

Message:
Logged In: YES 
user_id=12800

Although I haven't looked at the patch, I agree with Tim
that it would be okay to apply for 2.2 as long as it is
completely self-contained in mmap, has documentation and
test cases, and imposes no backwards incompatibility.  From
the comments it seems like all these conditions are met.

Assigning back to Tim because I don't know who it was
originally assigned to.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-11-04 19:10

Message:
Logged In: YES 
user_id=31435

Assigned to Barry in his Release Manager role:  accept or 
postpone?  I don't count it as "new feature" -- this is 
exposing what the platform mmap does, and it was always a 
flaw (if not a bug) that the Windows implementation didn't 
expose all the functionality exposed on Unix (Windows can 
handle it, it seems the original author(s) just didn't 
realize that).

----------------------------------------------------------------------

Comment By: Jay T Miller (jaytmiller)
Date: 2001-11-04 03:53

Message:
Logged In: YES 
user_id=320512

I created a 2nd generation patch which addresses the
following:

1. mmapmodule.c is indented according to PEP-7.

2. documentation typos are corrected and the prose is more
direct.

3. exception class for readonly access violations changed
from ValueError to TypeError.  (Thanks Tim!)



----------------------------------------------------------------------

Comment By: Jay T Miller (jaytmiller)
Date: 2001-11-03 06:23

Message:
Logged In: YES 
user_id=320512

I'll make the improvements pronto.  The patch only exposes minor new functionality on Win32 (it's already 
exposed on UNIX) and should be fully backwards compatible;  There is no requirement to use the new 
optional keyword.  Is there any chance for 2.2?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-11-02 16:09

Message:
Logged In: YES 
user_id=21627

Since this patch introduces a significant new feature, I'd 
recommend to postpone it until after 2.2.

The patch itself looks ok, but the following improvements 
should be made:
- indentation is incorrect, please see PEP 7.
- the documentation has some typos, ACCES_ -> ACCESS_
- if possible, the documentation should indicate that
  the additional parameters are new to Python 2.3.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=477161&group_id=5470