Skip to content

Commit

Permalink
Merge pull request eclipse-omr#7543 from dmitripivkine/master
Browse files Browse the repository at this point in the history
Extend vmState to pre/post collect
  • Loading branch information
babsingh authored Nov 13, 2024
2 parents 7c9c29e + c23b53a commit f7360a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gc/base/Collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,23 +489,21 @@ MM_Collector::garbageCollect(MM_EnvironmentBase* env, MM_MemorySubSpace* calling
{
Assert_MM_mustHaveExclusiveVMAccess(env->getOmrVMThread());

uintptr_t vmState = env->pushVMstate(getVMStateID());

Assert_MM_true(NULL == env->_cycleState);
preCollect(env, callingSubSpace, allocateDescription, gcCode);
Assert_MM_true(NULL != env->_cycleState);

/* ensure that we aren't trying to collect while in a NoGC allocation */
Assert_MM_false(env->_isInNoGCAllocationCall);

uintptr_t vmState = env->pushVMstate(getVMStateID());

/* First do any pre-collection initialization of the collector*/
setupForGC(env);

/* perform the collection */
_gcCompleted = internalGarbageCollect(env, callingSubSpace, allocateDescription);

env->popVMstate(vmState);

/* now, see if we need to resume an allocation or replenishment attempt */
void* postCollectAllocationResult = NULL;
if (NULL != allocateDescription) {
Expand All @@ -527,6 +525,8 @@ MM_Collector::garbageCollect(MM_EnvironmentBase* env, MM_MemorySubSpace* calling
Assert_MM_true(NULL != env->_cycleState);
env->_cycleState = NULL;

env->popVMstate(vmState);

return postCollectAllocationResult;
}

Expand Down

0 comments on commit f7360a9

Please sign in to comment.