< prev index next >

src/hotspot/share/gc/g1/g1OopStarChunkedList.inline.hpp

Print this page
rev 52675 : 8213890: Implementation of JEP 344: Abortable Mixed Collections for G1
Reviewed-by:
Contributed-by: erik.helin@oracle.com, stefan.johansson@oracle.com
rev 52676 : imported patch AMGC-impl
rev 52679 : imported patch AMGC-tsch-rev1-log
rev 52682 : [mq]: AMGC-kbar-rev1b

@@ -33,14 +33,16 @@
 template <typename T>
 inline void G1OopStarChunkedList::push(ChunkedList<T*, mtGC>** field, T* p) {
   ChunkedList<T*, mtGC>* list = *field;
   if (list == NULL) {
     *field = new ChunkedList<T*, mtGC>();
+    _used_memory += sizeof(ChunkedList<T*, mtGC>);
   } else if (list->is_full()) {
     ChunkedList<T*, mtGC>* next = new ChunkedList<T*, mtGC>();
     next->set_next_used(list);
     *field = next;
+    _used_memory += sizeof(ChunkedList<T*, mtGC>);
   }
 
   (*field)->push(p);
 }
 

@@ -59,20 +61,16 @@
 inline void G1OopStarChunkedList::push_oop(oop* p) {
   push(&_oops, p);
 }
 
 template <typename T>
-size_t G1OopStarChunkedList::delete_list(ChunkedList<T*, mtGC>* c) {
-  size_t freed = 0;
-  size_t chunk_size = sizeof(ChunkedList<T*, mtGC>);
+void G1OopStarChunkedList::delete_list(ChunkedList<T*, mtGC>* c) {
   while (c != NULL) {
     ChunkedList<T*, mtGC>* next = c->next_used();
-    freed += chunk_size;
     delete c;
     c = next;
   }
-  return freed;
 }
 
 template <typename T>
 void G1OopStarChunkedList::chunks_do(ChunkedList<T*, mtGC>* head, OopClosure* cl) {
   for (ChunkedList<T*, mtGC>* c = head; c != NULL; c = c->next_used()) {
< prev index next >