[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What's the point to keep mmaped objectfile opened?
From: |
rixed |
Subject: |
Re: What's the point to keep mmaped objectfile opened? |
Date: |
Tue, 13 Dec 2011 14:43:34 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
-[ Tue, Dec 13, 2011 at 01:42:35PM +0100, Andy Wingo ]----
> If you close the fd, isn't the memory unmapped? Isn't that a bad thing?
>
> Maybe I was just under a big misconception here :)
That's a common misconception. The mapping of VM space to disk storage
is unrelated to the file descriptor set (or any program would have at
least a file descriptor opened for itself, since any program is mapped
into memory).
Compare for instance cat /proc/1/maps with ls -l /proc/1/fd.
As I said, the attached patch, which do closes the fd, actually works
(ie make check and my personal program works). So the memory is clearly
not unmapped :-)