Skip to content

Commit

Permalink
[VL] Fix usage of uninitialized variables
Browse files Browse the repository at this point in the history
Use of Uninitialized Variables
  • Loading branch information
jkhaliqi committed Jan 10, 2025
1 parent 4bdda17 commit 41f2e96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cpp/velox/compute/WholeStageResultIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ std::shared_ptr<velox::core::QueryCtx> WholeStageResultIterator::createNewVeloxQ

std::shared_ptr<ColumnarBatch> WholeStageResultIterator::next() {
tryAddSplitsToTask();
GLUTEN_CHECK(task_ != nullptr, "task_ is nullptr");
if (task_->isFinished()) {
return nullptr;
}
Expand Down
5 changes: 3 additions & 2 deletions cpp/velox/memory/VeloxMemoryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ListenableArbitrator : public velox::memory::MemoryArbitrator {
uint64_t shrinkCapacity(uint64_t targetBytes, bool allowSpill, bool allowAbort) override {
velox::memory::ScopedMemoryArbitrationContext ctx{};
facebook::velox::exec::MemoryReclaimer::Stats status;
velox::memory::MemoryPool* pool;
velox::memory::MemoryPool* pool = nullptr;
{
std::unique_lock guard{mutex_};
VELOX_CHECK_EQ(candidates_.size(), 1, "ListenableArbitrator should only be used within a single root pool");
Expand Down Expand Up @@ -178,7 +178,7 @@ class ListenableArbitrator : public velox::memory::MemoryArbitrator {
return freeBytes;
}

gluten::AllocationListener* listener_;
gluten::AllocationListener* listener_ = nullptr;
const uint64_t memoryPoolInitialCapacity_; // FIXME: Unused.
const uint64_t memoryPoolTransferCapacity_;
const uint64_t memoryReclaimMaxWaitMs_;
Expand Down Expand Up @@ -216,6 +216,7 @@ class ArbitratorFactoryRegister {

VeloxMemoryManager::VeloxMemoryManager(const std::string& kind, std::unique_ptr<AllocationListener> listener)
: MemoryManager(kind), listener_(std::move(listener)) {
GLUTEN_CHECK(listener_ != nullptr, "VeloxMemoryManager failed");
auto reservationBlockSize = VeloxBackend::get()->getBackendConf()->get<uint64_t>(
kMemoryReservationBlockSize, kMemoryReservationBlockSizeDefault);
auto memInitCapacity =
Expand Down

0 comments on commit 41f2e96

Please sign in to comment.