diff options
author | Adam Sandberg Ericsson <adam@sandbergericsson.se> | 2022-04-26 13:44:44 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-27 10:09:18 -0400 |
commit | 4419dd3afe2de8b24d2dd10fe6b4c7370b861d6d (patch) | |
tree | f4c8cb9b60f05dabdb1e597ed0a6c32c7e870206 | |
parent | 7f618fd308b8db016009254aa8bbeb935d9d30e6 (diff) | |
download | haskell-4419dd3afe2de8b24d2dd10fe6b4c7370b861d6d.tar.gz |
rts: add some more documentation to StgWeak closure type
-rw-r--r-- | rts/include/rts/storage/Closures.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/rts/include/rts/storage/Closures.h b/rts/include/rts/storage/Closures.h index f66526c5bb..09c7bfdb88 100644 --- a/rts/include/rts/storage/Closures.h +++ b/rts/include/rts/storage/Closures.h @@ -339,17 +339,28 @@ typedef struct _StgStableName { // Closure types: WEAK typedef struct _StgWeak { StgHeader header; + + // C finalizers, see StgCFinalizerList below + // + // Points to stg_NO_FINALIZER_closure to indicate no c finalizers. StgClosure *cfinalizers; + StgClosure *key; - StgClosure *value; // the actual value + StgClosure *value; // the actual value references by the weak reference + + // Haskell finalizer (type IO ()) + // + // Points to stg_NO_FINALIZER_closure to indicate no Haskell finalizer. StgClosure *finalizer; + struct _StgWeak *link; } StgWeak; // Linked list of c function pointer finalisers for a weak reference // -// See the addCFinalizerToWeak# primop where these are constructed. +// See the addCFinalizerToWeak# primop where these are constructed and +// runCFinalizers (C) where they are consumed. // // Closure type: CONSTR typedef struct _StgCFinalizerList { |