< prev index next >

src/hotspot/share/gc/shared/cardTable.cpp

Print this page
rev 58025 : imported patch 8238854-remove-superfluous-alloc-checks
rev 58026 : [mq]: 8238854-sjohanss-review

@@ -59,10 +59,13 @@
   assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
 
   assert(card_size <= 512, "card_size must be less than 512"); // why?
 
   _covered = new MemRegion[_max_covered_regions];
+  if (_covered == NULL) {
+    vm_exit_during_initialization("Could not allocate card table covered region set.");
+  }
 }
 
 CardTable::~CardTable() {
   if (_covered) {
     delete[] _covered;

@@ -83,10 +86,13 @@
   HeapWord* low_bound  = _whole_heap.start();
   HeapWord* high_bound = _whole_heap.end();
 
   _cur_covered_regions = 0;
   _committed = new MemRegion[_max_covered_regions];
+  if (_committed == NULL) {
+    vm_exit_during_initialization("Could not allocate card table committed region set.");
+  }
 
   const size_t rs_align = _page_size == (size_t) os::vm_page_size() ? 0 :
     MAX2(_page_size, (size_t) os::vm_allocation_granularity());
   ReservedSpace heap_rs(_byte_map_size, rs_align, false);
 
< prev index next >