< prev index next >

src/hotspot/share/runtime/synchronizer.cpp

Print this page
*** 1073,21 ***
      // BEWARE: As it stands currently, we don't run the ctors!
      assert(_BLOCKSIZE > 1, "invariant");
      size_t neededsize = sizeof(PaddedObjectMonitor) * _BLOCKSIZE;
      PaddedObjectMonitor* temp;
      size_t aligned_size = neededsize + (DEFAULT_CACHE_LINE_SIZE - 1);
!     void* real_malloc_addr = (void*)NEW_C_HEAP_ARRAY(char, aligned_size,
-                                                      mtInternal);
      temp = (PaddedObjectMonitor*)align_up(real_malloc_addr, DEFAULT_CACHE_LINE_SIZE);
- 
-     // NOTE: (almost) no way to recover if allocation failed.
-     // We might be able to induce a STW safepoint and scavenge enough
-     // ObjectMonitors to permit progress.
-     if (temp == NULL) {
-       vm_exit_out_of_memory(neededsize, OOM_MALLOC_ERROR,
-                             "Allocate ObjectMonitors");
-     }
      (void)memset((void *) temp, 0, neededsize);
  
      // Format the block.
      // initialize the linked list, each monitor points to its next
      // forming the single linked free list, the very first monitor
--- 1073,12 ---
      // BEWARE: As it stands currently, we don't run the ctors!
      assert(_BLOCKSIZE > 1, "invariant");
      size_t neededsize = sizeof(PaddedObjectMonitor) * _BLOCKSIZE;
      PaddedObjectMonitor* temp;
      size_t aligned_size = neededsize + (DEFAULT_CACHE_LINE_SIZE - 1);
!     void* real_malloc_addr = NEW_C_HEAP_ARRAY(char, aligned_size, mtInternal);
      temp = (PaddedObjectMonitor*)align_up(real_malloc_addr, DEFAULT_CACHE_LINE_SIZE);
      (void)memset((void *) temp, 0, neededsize);
  
      // Format the block.
      // initialize the linked list, each monitor points to its next
      // forming the single linked free list, the very first monitor
< prev index next >