Skip to content

Commit

Permalink
Free
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsaka committed May 24, 2024
1 parent 80c6abb commit d6b0787
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions velox/common/memory/MemoryAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ bool MemoryAllocator::allocateContiguous(
success = cache()->makeSpace(
pagesToAcquire(numPages, numCollateralPages),
[&](Allocation& acquired) {
freeNonContiguous(acquired);
unmap(acquired.numPages());
return allocateContiguousWithoutRetry(
numPages, collateral, allocation, maxPages);
Expand Down Expand Up @@ -306,6 +307,7 @@ bool MemoryAllocator::growContiguous(
} else {
success = cache()->makeSpace(increment, [&](Allocation& acquired) {
freeNonContiguous(acquired);
unmap(acquired.numPages());
return growContiguousWithoutRetry(increment, allocation);
});
}
Expand Down

0 comments on commit d6b0787

Please sign in to comment.