New submission from Hirokazu Yamamoto <ocean-c...@m2.ccsnet.ne.jp>: 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. ---------- components: Extension Modules messages: 82253 nosy: ocean-city severity: normal status: open title: mmap.resize and offset type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5282> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com