changeset 1158:5f932a151fd4

6895788: G1: SATB and update buffer allocation code allocates too much space Summary: The type in the NEW_C_HEAP_ARRRY and FREE_C_HEAP_ARRAY calls in the buffer allocation code was changed from void* to char as the size argument had already been mulitipled by the byte size of an object pointer. Reviewed-by: ysr, tonyp
author johnc
date Fri, 06 Nov 2009 11:10:05 -0800
parents 26f1542097f1
children 0e2d7ae2bc67
files src/share/vm/gc_implementation/g1/ptrQueue.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Tue Nov 03 16:43:16 2009 -0800
+++ b/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Fri Nov 06 11:10:05 2009 -0800
@@ -107,7 +107,7 @@
     res[0] = NULL;
     return res;
   } else {
-    return NEW_C_HEAP_ARRAY(void*, _sz);
+    return (void**) NEW_C_HEAP_ARRAY(char, _sz);
   }
 }
 
@@ -127,7 +127,8 @@
     assert(_buf_free_list != NULL, "_buf_free_list_sz must be wrong.");
     void** head = _buf_free_list;
     _buf_free_list = (void**)_buf_free_list[0];
-    FREE_C_HEAP_ARRAY(void*,head);
+    FREE_C_HEAP_ARRAY(char, head);
+    _buf_free_list_sz --;
     n--;
   }
 }