This is an automated email from the git hooks/post-receive script.

wingo pushed a commit to branch wip-whippet
in repository guile.

The following commit(s) were added to refs/heads/wip-whippet by this push:
     new 4c7633257 guardians: speed up atomic fifo
4c7633257 is described below

commit 4c76332570cb7658971042af12a9171f1d1c3780
Author: Andy Wingo <wi...@pobox.com>
AuthorDate: Sun May 4 20:54:15 2025 +0200

    guardians: speed up atomic fifo
    
    * module/ice-9/guardians.scm (make-atomic-fifo): Instead of transferring
    the last element to the outbox, just return it.
---
 module/ice-9/guardians.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/ice-9/guardians.scm b/module/ice-9/guardians.scm
index f5c181748..ef050475b 100644
--- a/module/ice-9/guardians.scm
+++ b/module/ice-9/guardians.scm
@@ -65,6 +65,7 @@
   (define (transfer! in out)
     (match in
       (() (values))
+      ((x) x)
       ((x . in*)
        (let* ((out* (cons x out))
               (out** (atomic-box-compare-and-swap! outbox out out*)))
@@ -83,8 +84,7 @@
          (match (atomic-box-swap! inbox '())
            (() #f)
            (in
-            (transfer! in '())
-            (pop!)))))))
+            (transfer! in '())))))))
   (values push! pop!))
 
 (define (make-guardian)

Reply via email to