diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-12-10 15:04:25 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-12-10 15:04:25 +0000 |
commit | 6c095bfa3c8c81b52ad92853acd326453d320d7b (patch) | |
tree | 3f7658288a4f7f0744bb4959ca5a6113cf02babd /includes | |
parent | d4a17c3a253d02c2ebf2315e71a29cb740278977 (diff) | |
download | haskell-6c095bfa3c8c81b52ad92853acd326453d320d7b.tar.gz |
FIX #1364: added support for C finalizers that run as soon as the value is not longer reachable.
Patch originally by Ivan Tomac <tomac@pacific.net.au>, amended by
Simon Marlow:
- mkWeakFinalizer# commoned up with mkWeakFinalizerEnv#
- GC parameters to ALLOC_PRIM fixed
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Closures.h | 1 | ||||
-rw-r--r-- | includes/StgMiscClosures.h | 2 | ||||
-rw-r--r-- | includes/mkDerivedConstants.c | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/includes/Closures.h b/includes/Closures.h index 05cf7baaf8..15955fdcba 100644 --- a/includes/Closures.h +++ b/includes/Closures.h @@ -190,6 +190,7 @@ typedef struct _StgStableName { typedef struct _StgWeak { /* Weak v */ StgHeader header; + StgClosure *cfinalizer; StgClosure *key; StgClosure *value; /* v */ StgClosure *finalizer; diff --git a/includes/StgMiscClosures.h b/includes/StgMiscClosures.h index 8911cf3a09..460adeb8a6 100644 --- a/includes/StgMiscClosures.h +++ b/includes/StgMiscClosures.h @@ -582,6 +582,8 @@ RTS_FUN(isCurrentThreadBoundzh_fast); RTS_FUN(threadStatuszh_fast); RTS_FUN(mkWeakzh_fast); +RTS_FUN(mkWeakForeignzh_fast); +RTS_FUN(mkWeakForeignEnvzh_fast); RTS_FUN(finalizzeWeakzh_fast); RTS_FUN(deRefWeakzh_fast); diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c index 116b2e9971..d993643a4c 100644 --- a/includes/mkDerivedConstants.c +++ b/includes/mkDerivedConstants.c @@ -376,6 +376,7 @@ main(int argc, char *argv[]) closure_field(StgWeak,key); closure_field(StgWeak,value); closure_field(StgWeak,finalizer); + closure_field(StgWeak,cfinalizer); closure_size(StgDeadWeak); closure_field(StgDeadWeak,link); |