From 4eca5063db89f6992537f5f97afa78fab4f3bafc Mon Sep 17 00:00:00 2001 From: Adam Sandberg Ericsson Date: Tue, 26 Apr 2022 13:44:44 +0100 Subject: rts: add some more documentation to StgWeak closure type --- rts/include/rts/storage/Closures.h | 15 +++++++++++++-- 1 file 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 { -- cgit v1.2.1