SET_ARR_HDR's last argument is now a number of bytes, rather than words
authorIan Lynagh <igloo@earth.li>
Sat, 19 Jun 2010 23:52:14 +0000 (23:52 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Jun 2010 23:52:14 +0000 (23:52 +0000)
This avoids unnecessary work and potential loss of information

includes/rts/storage/ClosureMacros.h
rts/Adjustor.c

index fa6a2a5..aead2ed 100644 (file)
        SET_PROF_HDR((StgClosure *)(c),ccs);            \
    }
 
-#define SET_ARR_HDR(c,info,costCentreStack,n_words)    \
+#define SET_ARR_HDR(c,info,costCentreStack,n_bytes)    \
    SET_HDR(c,info,costCentreStack);                    \
-   (c)->bytes = n_words*sizeof(W_);
+   (c)->bytes = n_bytes;
 
 // Use when changing a closure from one kind to another
 #define OVERWRITE_INFO(c, new_info)                             \
index dd974e2..382f74a 100644 (file)
@@ -225,7 +225,7 @@ stgAllocStable(size_t size_in_bytes, StgStablePtr *stable)
   
   /* allocate and fill it in */
   arr = (StgArrWords *)allocate(total_size_in_words);
-  SET_ARR_HDR(arr, &stg_ARR_WORDS_info, CCCS, data_size_in_words);
+  SET_ARR_HDR(arr, &stg_ARR_WORDS_info, CCCS, size_in_bytes);
  
   /* obtain a stable ptr */
   *stable = getStablePtr((StgPtr)arr);