[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simplifying revealed ports

From: Ludovic Courtès
Subject: Re: Simplifying revealed ports
Date: Wed, 25 Oct 2017 11:49:12 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

address@hidden (Ludovic Courtès) skribis:

> While debugging <>, I was surprised to see
> that revealed ports were not GC’d at all.  The manual suggests otherwise
> (info "(guile) Ports and File Descriptors"):
>   If a port’s revealed count is greater than zero, the file descriptor
>   will not be closed when the port is garbage collected.
> That revealed ports are not GC’d makes it easy to shoot oneself in the
> foot the way I did (huge memory leak).
> So what about the simplification below?
> It creates one observable difference: ‘close-port’ does nothing on a
> revealed port, whereas until now it would close the port even if it has
> a non-zero revealed count.  I would argue that it’s acceptable though.

Having ‘close-port’ close revealed counts turned out to matter, as shown
by popen.test.

I adjusted the code accordingly, added test cases, and pushed:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]