Skip to content

Commit

Permalink
Merge pull request #17503 from amicic/array_ctor_fix
Browse files Browse the repository at this point in the history
Fix array constructor for Object Lists
  • Loading branch information
dmitripivkine committed Jun 1, 2023
2 parents 283b706 + e1f59ce commit 91c8570
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions runtime/gc_base/ContinuationObjectList.cpp
Expand Up @@ -52,9 +52,8 @@ MM_ContinuationObjectList::newInstanceArray(MM_EnvironmentBase *env, uintptr_t a

continuationObjectLists = (MM_ContinuationObjectList *)env->getForge()->allocate(sizeof(MM_ContinuationObjectList) * arrayElements, MM_AllocationCategory::FIXED, J9_GET_CALLSITE());
if (NULL != continuationObjectLists) {
new(continuationObjectLists) MM_ContinuationObjectList[arrayElements]();

for (uintptr_t index = 0; index < arrayElements; index++) {
new(&continuationObjectLists[index]) MM_ContinuationObjectList();
continuationObjectLists[index].initialize(env);
}
}
Expand Down
3 changes: 1 addition & 2 deletions runtime/gc_base/OwnableSynchronizerObjectList.cpp
Expand Up @@ -52,9 +52,8 @@ MM_OwnableSynchronizerObjectList::newInstanceArray(MM_EnvironmentBase *env, uint

ownableSynchronizerObjectLists = (MM_OwnableSynchronizerObjectList *)env->getForge()->allocate(sizeof(MM_OwnableSynchronizerObjectList) * arrayElements, MM_AllocationCategory::FIXED, J9_GET_CALLSITE());
if (NULL != ownableSynchronizerObjectLists) {
new(ownableSynchronizerObjectLists) MM_OwnableSynchronizerObjectList[arrayElements]();

for (uintptr_t index = 0; index < arrayElements; index++) {
new(&ownableSynchronizerObjectLists[index]) MM_OwnableSynchronizerObjectList();
ownableSynchronizerObjectLists[index].initialize(env);
}
}
Expand Down
3 changes: 1 addition & 2 deletions runtime/gc_base/ReferenceObjectList.cpp
Expand Up @@ -51,9 +51,8 @@ MM_ReferenceObjectList::newInstanceArray(MM_EnvironmentBase *env, uintptr_t arra

referenceObjectLists = (MM_ReferenceObjectList *)env->getForge()->allocate(sizeof(MM_ReferenceObjectList) * arrayElements, MM_AllocationCategory::FIXED, J9_GET_CALLSITE());
if (NULL != referenceObjectLists) {
new(referenceObjectLists) MM_ReferenceObjectList[arrayElements]();

for (uintptr_t index = 0; index < arrayElements; index++) {
new(&referenceObjectLists[index]) MM_ReferenceObjectList();
referenceObjectLists[index].initialize(env);
}
}
Expand Down
3 changes: 1 addition & 2 deletions runtime/gc_base/UnfinalizedObjectList.cpp
Expand Up @@ -49,9 +49,8 @@ MM_UnfinalizedObjectList::newInstanceArray(MM_EnvironmentBase *env, uintptr_t ar

unfinalizedObjectLists = (MM_UnfinalizedObjectList *)env->getForge()->allocate(sizeof(MM_UnfinalizedObjectList) * arrayElements, MM_AllocationCategory::FIXED, J9_GET_CALLSITE());
if (NULL != unfinalizedObjectLists) {
new(unfinalizedObjectLists) MM_UnfinalizedObjectList[arrayElements]();

for (uintptr_t index = 0; index < arrayElements; index++) {
new(&unfinalizedObjectLists[index]) MM_UnfinalizedObjectList();
unfinalizedObjectLists[index].initialize(env);
}
}
Expand Down

0 comments on commit 91c8570

Please sign in to comment.