[Git][ghc/ghc][master] ghc-heap: Support for BLOCKING_QUEUE closures

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Jul 3 07:29:13 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
4aac0540 by Ben Gamari at 2023-07-03T03:28:42-04:00
ghc-heap: Support for BLOCKING_QUEUE closures

- - - - -


2 changed files:

- libraries/ghc-heap/GHC/Exts/Heap.hs
- rts/Heap.c


Changes:

=====================================
libraries/ghc-heap/GHC/Exts/Heap.hs
=====================================
@@ -317,8 +317,9 @@ getClosureDataFromHeapRepPrim getConDesc decodeCCS itbl heapRep pts = do
             _ -> fail $ "Expected at least 3 ptrs to MVAR, found "
                         ++ show (length pts)
 
-        BLOCKING_QUEUE ->
-            pure $ OtherClosure itbl pts rawHeapWords
+        BLOCKING_QUEUE
+          | [_link, bh, _owner, msg] <- pts ->
+            pure $ BlockingQueueClosure itbl _link bh _owner msg
 
         WEAK -> case pts of
             pts0 : pts1 : pts2 : pts3 : rest -> pure $ WeakClosure


=====================================
rts/Heap.c
=====================================
@@ -245,6 +245,16 @@ StgWord collect_pointers(StgClosure *closure, StgClosure *ptrs[]) {
             // See the note in AP_STACK about the stack chunk.
             break;
 
+        case BLOCKING_QUEUE:
+        {
+            StgBlockingQueue *bq = (StgBlockingQueue *) closure;
+            ptrs[nptrs++] = (StgClosure *) bq->link;
+            ptrs[nptrs++] = bq->bh;
+            ptrs[nptrs++] = (StgClosure *) bq->owner;
+            ptrs[nptrs++] = (StgClosure *) bq->queue;
+            break;
+        }
+
         default:
             fprintf(stderr,"closurePtrs: Cannot handle type %s yet\n",
                            closure_type_names[info->type]);



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4aac0540a8180be0ac6b497c5617807031e0dfa4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4aac0540a8180be0ac6b497c5617807031e0dfa4
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230703/218dfda0/attachment-0001.html>


More information about the ghc-commits mailing list