8227168: Cleanup usage of NEW_C_HEAP_ARRAY

Reviewed-by: coleenp, dholmes, kbarrett, tschatzl
This commit is contained in:
Leo Korinth 2019-09-11 14:16:27 +02:00
parent a73f96ef60
commit eafb888c18
23 changed files with 73 additions and 89 deletions

View file

@ -1075,17 +1075,8 @@ ObjectMonitor* ObjectSynchronizer::om_alloc(Thread* self) {
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);
void* real_malloc_addr = 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.