From 72c7154006a78a5f51ae4d14467cb0d29a26c96c Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 8 Mar 1999 16:41:24 +0000 Subject: [PATCH] [project @ 1999-03-08 16:41:24 by sof] enlargeStablePtrTable: initialise the whole table (incl. index 0) the first time around. --- ghc/rts/Stable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ghc/rts/Stable.c b/ghc/rts/Stable.c index 206772f..4244bca 100644 --- a/ghc/rts/Stable.c +++ b/ghc/rts/Stable.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Stable.c,v 1.3 1999/02/26 12:46:48 simonm Exp $ + * $Id: Stable.c,v 1.4 1999/03/08 16:41:24 sof Exp $ * * (c) The GHC Team, 1998-1999 * @@ -133,7 +133,9 @@ initFreeList(snEntry *table, nat n, snEntry *free) snEntry *p; for (p = table + n - 1; p >= table; p--) { - p->addr = (P_)free; + p->addr = (P_)free; + p->weight = 0; + p->sn_obj = NULL; free = p; } stable_ptr_free = table; @@ -226,7 +228,7 @@ enlargeStablePtrTable(void) stable_ptr_table = stgMallocWords(SPT_size * sizeof(snEntry), "initStablePtrTable"); - initFreeList(stable_ptr_table+1,INIT_SPT_SIZE-1,NULL); + initFreeList(stable_ptr_table,INIT_SPT_SIZE,NULL); addrToStableHash = allocHashTable(); } else { -- 1.7.10.4