Message82253
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. |
|
Date |
User |
Action |
Args |
2009-02-16 17:22:57 | ocean-city | set | recipients:
+ ocean-city |
2009-02-16 17:22:56 | ocean-city | set | messageid: <1234804976.91.0.251339540511.issue5282@psf.upfronthosting.co.za> |
2009-02-16 17:21:47 | ocean-city | link | issue5282 messages |
2009-02-16 17:21:46 | ocean-city | create | |
|