Tim Golden <m...@timgolden.me.uk> added the comment: Hirokazu Yamamoto wrote: > Hirokazu Yamamoto <ocean-c...@m2.ccsnet.ne.jp> added the comment: > > I reconsidered this issue. When mmap is anonymous, > self->file_handle == INVALID_HANDLE_VALUE (-1), so we should not call > SetFilePointer and SetEndOfFile for this handle.
I'm inclined to agree. I must admit, I was pushing a change which changed as little as possible; I think, in hindsight, it does *too* little. > For file mapping object, mmap.resize() resizes underlying file too, but > for anonymous mapping object, doesn't resize memory region itself. I > cannot find the Win32API to resize memory region created by > CreateFileMapping. I'm not sure this difference is intended by mmap > module writer. Maybe is_resizeable(mmap_object *self) should return 0 > for anonymous mapping object on windows. (Of course, such difference > might be acceptable because mmap.size() already have such difference) I have no strong opinion myself. In reality I rarely use mmaps; I merely saw the call in the recent bug cleanup and thought I might be of use. I'm not sure who's best placed to decide what should happen, but my feeling is that altering the existing interface by, eg, removing the ability of an anonymous Windows mmap to resize is not a good idea. There may be code which is already using it. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2733> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com