diff options
author | Andy Wingo <wingo@pobox.com> | 2012-02-19 13:29:59 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-02-19 13:30:30 +0100 |
commit | bc1bc9e32088958c1b381f9ec0056e40340433a1 (patch) | |
tree | e18a321947f161575c1a98bb4136e60279981d0a | |
parent | 8dfb7bbfd908ca883d0fdd0d868e13e6b20803ae (diff) | |
download | guile-bc1bc9e32088958c1b381f9ec0056e40340433a1.tar.gz |
ice-9/poll optimization
* module/ice-9/poll.scm (poll-set-add!): Use fileno instead of
port->fdes, to avoid manipulating revealed counts.
-rw-r--r-- | module/ice-9/poll.scm | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/module/ice-9/poll.scm b/module/ice-9/poll.scm index 2ba868748..1633dcbc5 100644 --- a/module/ice-9/poll.scm +++ b/module/ice-9/poll.scm @@ -1,6 +1,6 @@ ;; poll -;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -139,13 +139,7 @@ (off (pollfd-offset idx)) (fd (if (integer? fd-or-port) fd-or-port - (port->fdes fd-or-port)))) - - (if (port? fd-or-port) - ;; As we store the port in the fdset, there is no need to - ;; increment the revealed count to prevent the fd from being - ;; closed by a gc'd port. - (release-port-handle fd-or-port)) + (fileno fd-or-port)))) (ensure-pset-size! set (1+ idx)) (bytevector-s32-native-set! (pset-pollfds set) off fd) |