< prev index next >

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

Print this page




  55 }
  56 
  57 inline void G1OopStarChunkedList::push_oop(narrowOop* p) {
  58   push(&_coops, p);
  59 }
  60 
  61 inline void G1OopStarChunkedList::push_oop(oop* p) {
  62   push(&_oops, p);
  63 }
  64 
  65 template <typename T>
  66 void G1OopStarChunkedList::delete_list(ChunkedList<T*, mtGC>* c) {
  67   while (c != NULL) {
  68     ChunkedList<T*, mtGC>* next = c->next_used();
  69     delete c;
  70     c = next;
  71   }
  72 }
  73 
  74 template <typename T>
  75 size_t G1OopStarChunkedList::chunks_do(ChunkedList<T*, mtGC>* head, OopClosure* cl) {
  76   size_t result = 0;
  77   for (ChunkedList<T*, mtGC>* c = head; c != NULL; c = c->next_used()) {
  78     result += c->size();
  79     for (size_t i = 0; i < c->size(); i++) {
  80       T* p = c->at(i);
  81       cl->do_oop(p);
  82     }
  83   }
  84   return result;
  85 }
  86 
  87 #endif // SHARE_GC_G1_G1OOPSTARCHUNKEDLIST_INLINE_HPP


  55 }
  56 
  57 inline void G1OopStarChunkedList::push_oop(narrowOop* p) {
  58   push(&_coops, p);
  59 }
  60 
  61 inline void G1OopStarChunkedList::push_oop(oop* p) {
  62   push(&_oops, p);
  63 }
  64 
  65 template <typename T>
  66 void G1OopStarChunkedList::delete_list(ChunkedList<T*, mtGC>* c) {
  67   while (c != NULL) {
  68     ChunkedList<T*, mtGC>* next = c->next_used();
  69     delete c;
  70     c = next;
  71   }
  72 }
  73 
  74 template <typename T>
  75 void G1OopStarChunkedList::chunks_do(ChunkedList<T*, mtGC>* head, OopClosure* cl) {

  76   for (ChunkedList<T*, mtGC>* c = head; c != NULL; c = c->next_used()) {

  77     for (size_t i = 0; i < c->size(); i++) {
  78       T* p = c->at(i);
  79       cl->do_oop(p);
  80     }
  81   }

  82 }
  83 
  84 #endif // SHARE_GC_G1_G1OOPSTARCHUNKEDLIST_INLINE_HPP
< prev index next >