diff options
author | Adam Sandberg Ericsson <adam@sandbergericsson.se> | 2022-04-26 13:44:44 +0100 |
---|---|---|
committer | Adam Sandberg Ericsson <adam@sandbergericsson.se> | 2022-04-26 13:45:35 +0100 |
commit | 4eca5063db89f6992537f5f97afa78fab4f3bafc (patch) | |
tree | ae0d3503bbf1cfcd7357f438d80da207964bcb65 | |
parent | f2c08124b30eb87482dc0ed1d7199aa58950e309 (diff) | |
download | haskell-4eca5063db89f6992537f5f97afa78fab4f3bafc.tar.gz |
rts: add some more documentation to StgWeak closure typewip/adamse/weak-closure-docs
-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 { |