This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ocean-city
Recipients ocean-city
Date 2009-02-16.17:21:46
SpamBayes Score 1.3116373e-08
Marked as misclassified No
Message-id <1234804976.91.0.251339540511.issue5282@psf.upfronthosting.co.za>
In-reply-to
Content
This is first time to look at mmap module, so sorry if I'm saying
totally wrong thing. (I noticed this when I saw issue2733) I think the
behavior of mmap_resize_method is unclear when mapping object is created
with offset > 0.

From view of other functions, it seems that self->offset is offset from
beginning of the file, and self->size is the size of mapped area from
self->offset. If so,

#if SIZEOF_SIZE_T > 4
    newSizeHigh = (DWORD)((self->offset + new_size) >> 32);
    newSizeLow = (DWORD)((self->offset + new_size) & 0xFFFFFFFF);
#else
    newSizeHigh = 0;
    newSizeLow = (DWORD)new_size; /* shouldn't add self->offset? this is
not doing same thing as SIZEOF_SIZE_T > 4 */
#endif

And on unix part,
    newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE);
self->offset is totally ignored. I think when self->offset > 0,
something wrong happens.

And comment above function definition saids,

 / Is this really necessary?  This could easily be done
 / from python by just closing and re-opening with the
 / new size?

I think this function is not tested well. There is no test about
resize+offset in test_mmap.py.
History
Date User Action Args
2009-02-16 17:22:57ocean-citysetrecipients: + ocean-city
2009-02-16 17:22:56ocean-citysetmessageid: <1234804976.91.0.251339540511.issue5282@psf.upfronthosting.co.za>
2009-02-16 17:21:47ocean-citylinkissue5282 messages
2009-02-16 17:21:46ocean-citycreate