[darcs-users] strange bug with Windows share mounted on Mac OS X
Peter Strand
peter at zarquon.se
Wed Oct 20 12:49:10 UTC 2004
David Roundy wrote:
> I don't actually check on whether mmap is safe. I just open a temporary
> file and try to delete it before closing it. If it fails, we're on a
> system where mmap could be dangerous, since we never explicitly munmap
> (leave that to the GC), so we don't mmap. And I only run the check before
> doing an mmap_slurp, which itself is a slow operation, so I don't think the
> cost will be noticable.
Wouldn't it be enough to do this test just once, perhaps in the _darcs
directory, and avoid mmap if it fails?
Then we could get rid of the --disable-mmap flag to configure and always
rely on run-time testing.
I think the win32 code for mmap still is slightly broken, it leaks
handles, I didn't bother to send patches for that since it wouldn't work
anyway.
However, is it ever useful to mmap files without relying on finalizers
to unmap them? i.e. explicitly unmap?
In that case we could start to use mmap in windows as well, where it is
safe wrt. unmapping.
/Peter
More information about the darcs-users
mailing list