hotspot/src/share/vm/runtime/jniHandles.cpp
changeset 25058 4542f853c2ac
parent 24424 2658d7834c6e
child 32607 c69a7b61ab02
equal deleted inserted replaced
25057:f38210f84f8c 25058:4542f853c2ac
   296     }
   296     }
   297   }
   297   }
   298   block->_top  = 0;
   298   block->_top  = 0;
   299   block->_next = NULL;
   299   block->_next = NULL;
   300   block->_pop_frame_link = NULL;
   300   block->_pop_frame_link = NULL;
       
   301   block->_planned_capacity = block_size_in_oops;
   301   // _last, _free_list & _allocate_before_rebuild initialized in allocate_handle
   302   // _last, _free_list & _allocate_before_rebuild initialized in allocate_handle
   302   debug_only(block->_last = NULL);
   303   debug_only(block->_last = NULL);
   303   debug_only(block->_free_list = NULL);
   304   debug_only(block->_free_list = NULL);
   304   debug_only(block->_allocate_before_rebuild = -1);
   305   debug_only(block->_allocate_before_rebuild = -1);
   305   return block;
   306   return block;
   529     result++;
   530     result++;
   530   }
   531   }
   531   return result;
   532   return result;
   532 }
   533 }
   533 
   534 
       
   535 const size_t JNIHandleBlock::get_number_of_live_handles() {
       
   536   CountHandleClosure counter;
       
   537   oops_do(&counter);
       
   538   return counter.count();
       
   539 }
       
   540 
   534 // This method is not thread-safe, i.e., must be called while holding a lock on the
   541 // This method is not thread-safe, i.e., must be called while holding a lock on the
   535 // structure.
   542 // structure.
   536 long JNIHandleBlock::memory_usage() const {
   543 long JNIHandleBlock::memory_usage() const {
   537   return length() * sizeof(JNIHandleBlock);
   544   return length() * sizeof(JNIHandleBlock);
   538 }
   545 }