hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp
changeset 1560 1b328492b7f8
parent 1374 4c24294029a9
child 1623 a0dd9009e992
--- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Fri Nov 07 12:52:16 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Fri Nov 14 14:23:05 2008 -0800
@@ -30,7 +30,7 @@
   _perm(perm), _lock(NULL)
 {}
 
-PtrQueue::~PtrQueue() {
+void PtrQueue::flush() {
   if (!_perm && _buf != NULL) {
     if (_index == _sz) {
       // No work to do.
@@ -41,8 +41,9 @@
         _buf[byte_index_to_index((int)i)] = NULL;
       }
       qset()->enqueue_complete_buffer(_buf);
-      _buf = NULL;
     }
+    _buf = NULL;
+    _index = 0;
   }
 }