[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: |
Andy Wingo |
Subject: |
Re: What's the point to keep mmaped objectfile opened? |
Date: |
Tue, 13 Dec 2011 13:42:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On Tue 13 Dec 2011 11:15, address@hidden writes:
> I'm a little worried by the amount of file descriptors left opened
> after the objcode is mmaped.
> I saw this "note to self" from objcodes.c:
>
> /* FIXME: we leak ourselves and the file descriptor. but then again so does
>
> dlopen(). */
>
> So apparently the author was well aware of the problem but decided to
> ignore it, despite the fd being used nowhere as far as I can see
> (also, I don't understand the remark about dlopen leaking a fd).
>
> Anyway, the attached patch (which closes the fd and stores -1 inplace
> of it in the cell) seams to works and seams to fix the issue (ie. no more
> pending opened fd for .go files)
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 :)
Andy
--
http://wingolog.org/