summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/include/rts/storage/Closures.h15
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 {