Skip to content

Commit c58b9f8

Browse files
authored
Merge pull request #19465 from mpirvu/forloopfix
Change "for" loop from range-based to iterator based
2 parents b3944af + cfb4dff commit c58b9f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/compiler/env/PersistentAllocator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,9 @@ PersistentAllocator::disclaimAllSegments()
707707
TR::CompilationInfo *compInfo = TR::CompilationInfo::get(_javaVM.jitConfig);
708708
bool canDisclaimOnSwap = TR::Options::getCmdLineOptions()->getOption(TR_DisclaimMemoryOnSwap) && !compInfo->isSwapMemoryDisabled();
709709
j9thread_monitor_enter(_segmentMonitor);
710-
for (const J9MemorySegment &segment : _segments)
710+
for (auto segmentIterator = _segments.begin(); segmentIterator != _segments.end(); ++segmentIterator)
711711
{
712+
J9MemorySegment &segment = *segmentIterator;
712713
if (segment.vmemIdentifier.allocator == OMRPORT_VMEM_RESERVE_USED_MMAP_SHM || // Can disclaim to file
713714
((segment.vmemIdentifier.mode & J9PORT_VMEM_MEMORY_MODE_VIRTUAL) && canDisclaimOnSwap)) // Can disclaim to swap
714715
{

0 commit comments

Comments
 (0)