Replace an (incorrect) bytes-to-words calculation with ROUNDUP_BYTES_TO_WDS
authorIan Lynagh <igloo@earth.li>
Sat, 19 Jun 2010 23:51:06 +0000 (23:51 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Jun 2010 23:51:06 +0000 (23:51 +0000)
cbits/alloc.c

index 2b5959d..e1320a9 100644 (file)
@@ -69,7 +69,7 @@ stgAllocForGMP (size_t size_in_bytes)
   nat data_size_in_words, total_size_in_words;
 
   /* round up to a whole number of words */
-  data_size_in_words  = (size_in_bytes + sizeof(W_) + 1) / sizeof(W_);
+  data_size_in_words  = ROUNDUP_BYTES_TO_WDS(size_in_bytes);
   total_size_in_words = sizeofW(StgArrWords) + data_size_in_words;
 
   /* allocate and fill it in. */