[project @ 2001-08-08 15:44:28 by sewardj]
authorsewardj <unknown>
Wed, 8 Aug 2001 15:44:28 +0000 (15:44 +0000)
committersewardj <unknown>
Wed, 8 Aug 2001 15:44:28 +0000 (15:44 +0000)
Disable use of finalisers attached to UnlinkedBCOs, since finalisers
attached to non-atomic objects may run too early :-(

ghc/compiler/ghci/ByteCodeLink.lhs

index 310f6c4..325dc00 100644 (file)
@@ -191,7 +191,12 @@ assembleBCO (ProtoBCO nm instrs origin malloced)
             <- mkBits findLabel init_asm_state instrs
 
          let ul_bco = UnlinkedBCO nm final_insns final_lits final_ptrs final_itbls
-         when (not (null malloced)) (addFinalizer ul_bco (mapM_ zonk malloced))
+
+         -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive
+         -- objects, since they might get run too early.  Disable this until
+         -- we figure out what to do.
+         -- when (not (null malloced)) (addFinalizer ul_bco (mapM_ zonk malloced))
+
          return ul_bco
      where
          zonk (A# a#) = do -- putStrLn ("freeing malloc'd block at " ++ show (A# a#))