X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStorage.c;h=1119519e42a15ab4d08ae2f27c7a81f4537e3af0;hb=43b212f520c00ee42d2d711f26183cdb14096158;hp=8057660ecdb70318c0b3f4f9691ba8865c5b3f98;hpb=f33938a37e973057d93d2fd625cc9e205e5cad03;p=ghc-hetmet.git diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 8057660..1119519 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Storage.c,v 1.32 2001/01/16 12:02:04 simonmar Exp $ + * $Id: Storage.c,v 1.33 2001/01/24 15:46:19 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -216,6 +216,16 @@ newCAF(StgClosure* caf) ((StgMutClosure *)caf)->mut_link = oldest_gen->mut_once_list; oldest_gen->mut_once_list = (StgMutClosure *)caf; +#ifdef GHCI + /* For dynamically-loaded code, we retain all the CAFs. There is no + * way of knowing which ones we'll need in the future. + */ + if (is_dynamically_loaded_rwdata_ptr((StgPtr)caf)) { + caf->payload[2] = caf_list; /* IND_STATIC_LINK2() */ + caf_list = caf; + } +#endif + #ifdef INTERPRETER /* If we're Hugs, we also have to put it in the CAF table, so that the CAF can be reverted. When reverting, CAFs created by compiled @@ -231,6 +241,18 @@ newCAF(StgClosure* caf) RELEASE_LOCK(&sm_mutex); } +#ifdef GHCI +void +markCafs( void ) +{ + StgClosure *p; + + for (p = caf_list; p != NULL; p = STATIC_LINK2(get_itbl(p),p)) { + MarkRoot(p); + } +} +#endif /* GHCI */ + #ifdef INTERPRETER void newCAF_made_by_Hugs(StgCAF* caf)