X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStorage.c;h=367530fcb6a0467b109b9e891b0cc49769e0196b;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=f511b766882faef5adbab0918116ab4ccda9fd07;hpb=76ebf3dcb916a1116302896090059c9c32ab5c6a;p=ghc-hetmet.git diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index f511b76..367530f 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Storage.c,v 1.80 2003/09/23 15:38:36 simonmar Exp $ + * $Id: Storage.c,v 1.84 2004/08/13 13:11:01 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -22,7 +22,6 @@ #include "Storage.h" #include "Schedule.h" #include "OSThreads.h" -#include "StoragePriv.h" #include "RetainerProfile.h" // for counting memory blocks (memInventory) @@ -44,7 +43,7 @@ generation *g0 = NULL; /* generation 0, for convenience */ generation *oldest_gen = NULL; /* oldest generation, for convenience */ step *g0s0 = NULL; /* generation 0, step 0, for convenience */ -lnat total_allocated = 0; /* total memory allocated during run */ +ullong total_allocated = 0; /* total memory allocated during run */ /* * Storage manager mutex: protects all the above state from @@ -475,15 +474,11 @@ allocate( nat n ) nat req_blocks = (lnat)BLOCK_ROUND_UP(n*sizeof(W_)) / BLOCK_SIZE; bd = allocGroup(req_blocks); dbl_link_onto(bd, &g0s0->large_objects); + g0s0->n_large_blocks += req_blocks; bd->gen_no = 0; bd->step = g0s0; bd->flags = BF_LARGE; bd->free = bd->start + n; - /* don't add these blocks to alloc_blocks, since we're assuming - * that large objects are likely to remain live for quite a while - * (eg. running threads), so garbage collecting early won't make - * much difference. - */ alloc_blocks += req_blocks; RELEASE_SM_LOCK; return bd->start; @@ -625,7 +620,7 @@ stgAllocForGMP (size_t size_in_bytes) SET_ARR_HDR(arr, &stg_ARR_WORDS_info, CCCS, data_size_in_words); /* and return a ptr to the goods inside the array */ - return(BYTE_ARR_CTS(arr)); + return arr->payload; } static void *