Skip to content

Commit

Permalink
Merge pull request #20922 from LinHu2016/fix_unsafe_issue
Browse files Browse the repository at this point in the history
Fix potential issue in initializing unsafeIndexableHeaderSize
  • Loading branch information
amicic authored Jan 13, 2025
2 parents a0970db + 63db1b1 commit 51f7079
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions runtime/gc_modron_startup/mminit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3325,11 +3325,8 @@ initializeIndexableObjectHeaderSizes(J9JavaVM* vm)
#else /* defined(J9VM_ENV_DATA64) */
setIndexableObjectHeaderSizeWithoutDataAddress(vm);
#endif /* defined(J9VM_ENV_DATA64) */
if (MM_GCExtensions::getExtensions(vm)->isVirtualLargeObjectHeapEnabled) {
vm->unsafeIndexableHeaderSize = 0;
} else {
vm->unsafeIndexableHeaderSize = vm->contiguousIndexableHeaderSize;
}
/* set default unsafeIndexableHeaderSize */
vm->unsafeIndexableHeaderSize = vm->contiguousIndexableHeaderSize;
}

#if defined(J9VM_ENV_DATA64)
Expand All @@ -3356,7 +3353,6 @@ setIndexableObjectHeaderSizeWithoutDataAddress(J9JavaVM* vm)
vm->contiguousIndexableHeaderSize = sizeof(J9IndexableObjectContiguousFull);
vm->discontiguousIndexableHeaderSize = sizeof(J9IndexableObjectDiscontiguousFull);
}
vm->unsafeIndexableHeaderSize = vm->contiguousIndexableHeaderSize;
}

#if defined(OMR_GC_CONCURRENT_SCAVENGER)
Expand Down

0 comments on commit 51f7079

Please sign in to comment.