From bb288695c5e25ff185c323f07f79d66dd81a4d0c Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 15 Oct 2002 11:02:32 +0000 Subject: [PATCH] [project @ 2002-10-15 11:02:32 by simonmar] Slight fix to the allocated memory calculation --- ghc/rts/Storage.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 5a015d9..911e432 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Storage.c,v 1.68 2002/08/16 13:20:36 simonmar Exp $ + * $Id: Storage.c,v 1.69 2002/10/15 11:02:32 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -533,7 +533,15 @@ allocate( nat n ) lnat allocated_bytes( void ) { - return (alloc_blocks * BLOCK_SIZE_W - (alloc_HpLim - alloc_Hp)); + lnat allocated; + + allocated = alloc_blocks * BLOCK_SIZE_W - (alloc_HpLim - alloc_Hp); + if (pinned_object_block != NULL) { + allocated -= (pinned_object_block->start + BLOCK_SIZE_W) - + pinned_object_block->free; + } + + return allocated; } /* --------------------------------------------------------------------------- -- 1.7.10.4