Re: appending to a memory-mapped file
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jan 6, 2010, at 1:39 PM, Jean-Daniel Dupas wrote:
Just an idea, you can try to remap the same file with a larger size at the same address than the previous one using the MAP_FIXED flag. According to the man page, if you pass this flag, mmap try to "remove a mapping that already exists at that location". So it will automatically invalidate your previous mapping and create a new one with the new range (if there is enough room to do this of course, else it will failed).
It doesn't fail if there's not enough room; it just wipes out any other mappings that overlapped the address range. When I tried doing this, it ended up overwriting a large malloc zone, which caused some exciting and hard-to-debug crashes. :-( —Jens _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jens Alfke