[commit: ghc] master: Allow multiple C finalizers to be attached to a Weak# (d61c623)
Ian Lynagh
igloo at earth.li
Sat Jun 15 18:33:06 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/d61c623ed6b2d352474a7497a65015dbf6a72e12
>---------------------------------------------------------------
commit d61c623ed6b2d352474a7497a65015dbf6a72e12
Author: Takano Akio <aljee at hyper.cx>
Date: Thu Apr 18 18:30:23 2013 +0900
Allow multiple C finalizers to be attached to a Weak#
The commit replaces mkWeakForeignEnv# with addCFinalizerToWeak#.
This new primop mutates an existing Weak# object and adds a new
C finalizer to it.
This change removes an invariant in MarkWeak.c, namely that the relative
order of Weak# objects in the list needs to be preserved across GC. This
makes it easier to split the list into per-generation structures.
The patch also removes a race condition between two threads calling
finalizeWeak# on the same WEAK object at that same time.
compiler/prelude/primops.txt.pp | 11 ++-
includes/rts/storage/Closures.h | 12 ++--
includes/stg/MiscClosures.h | 2 +-
rts/Linker.c | 2 +-
rts/PrimOps.cmm | 113 ++++++++++++++++---------------
rts/StgMiscClosures.cmm | 9 +++
rts/Weak.c | 39 ++++-------
rts/Weak.h | 2 +-
rts/sm/Compact.c | 2 +-
rts/sm/MarkWeak.c | 5 +-
utils/deriveConstants/DeriveConstants.hs | 12 ++--
11 files changed, 110 insertions(+), 99 deletions(-)
Diff suppressed because of size. To see it, use:
git show d61c623ed6b2d352474a7497a65015dbf6a72e12
More information about the ghc-commits
mailing list