[Git][ghc/ghc][wip/ghc-heap-prim] ghc-heap: Support for BLOCKING_QUEUE closures
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Thu Jun 1 21:18:41 UTC 2023
Ben Gamari pushed to branch wip/ghc-heap-prim at Glasgow Haskell Compiler / GHC
Commits:
eef90f25 by Ben Gamari at 2023-06-01T17:18:32-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/eef90f25e8c7ee48471bc54184c8bb755219b152
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eef90f25e8c7ee48471bc54184c8bb755219b152
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/20230601/4ed083af/attachment-0001.html>
More information about the ghc-commits
mailing list