l...@gnu.org (Ludovic Courtès) skribis: > While debugging <https://bugs.gnu.org/28784>, 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: https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=1008ea315483d1fb41b2a8c10680e511238836d0 Ludo’.