< prev index next >

src/hotspot/share/memory/vtBuffer.cpp

Print this page

        

@@ -40,16 +40,18 @@
 int VTBuffer::_pool_counter = 0;
 int VTBuffer::_max_pool_counter = 0;
 int VTBuffer::_total_allocated = 0;
 int VTBuffer::_total_failed = 0;
 address VTBuffer::_base = NULL;
+address VTBuffer::_end = NULL;
 address VTBuffer::_commit_ptr;
 size_t VTBuffer::_size;
 
 void VTBuffer::init() {
   if ((!(EnableValhalla || EnableMVT)) || ValueTypesBufferMaxMemory == 0) {
     _base = NULL;
+    _end = NULL;
     _commit_ptr = NULL;
     _size = 0;
     return;
   }
   size_t size = ValueTypesBufferMaxMemory * os::vm_page_size();

@@ -60,13 +62,15 @@
     }
     // memory allocation failed, disabling buffering
     ValueTypesBufferMaxMemory = 0;
     _size = 0;
     _commit_ptr = NULL;
+    _end = NULL;
   } else {
     _commit_ptr = _base;
     _size = size;
+    _end = _base + _size;
   }
 }
 
 VTBufferChunk* VTBuffer::get_new_chunk(JavaThread* thread) {
   if (_commit_ptr  >= _base + _size) {
< prev index next >