Skip to content

Commit

Permalink
move growing into separate function and remove testing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
vladl2802 committed Oct 28, 2024
1 parent e5d9b3d commit 2ef04c8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,21 @@ class TState : public TComputationValue<TState> {
Tongue = CurrentPage->data() + CurrentPosition;
}
Throat = States.GetKey(itInsert) + KeyWidth;
if (isNew && !IsOutOfMemory) {
if (isNew) {
SafeGrow();
}
return isNew;
}

void SafeGrow() {
if (!IsOutOfMemory) {
try {
States.CheckGrow();
} catch (const TMemoryLimitExceededException& e) {
Cerr << "State " << (void *)this << " no longer growing\n";
IsOutOfMemory = true;
}
}
return isNew;
}

bool CheckIsOutOfMemory() const {
Expand Down Expand Up @@ -848,7 +854,6 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
}

bool IsSwitchToSpillingModeCondition() const {
return false;
return !HasMemoryForProcessing() || TlsAllocState->GetMaximumLimitValueReached();
}

Expand Down

0 comments on commit 2ef04c8

Please sign in to comment.