Skip to content

Commit

Permalink
xx
Browse files Browse the repository at this point in the history
  • Loading branch information
zuochunwei committed Jul 7, 2023
1 parent fc1f166 commit 2d03b05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion velox/common/file/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ struct HeapMemoryMock {
size_ += len;
}

void read(void* dst, size_ len, size_t offset) {
void read(void* dst, size_t len, size_t offset) {
assert(offset + len <= size_);
memcpy(dst, (char*)memory_ + offset, len);
}
Expand Down
7 changes: 4 additions & 3 deletions velox/exec/Spill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ void SpillFile::startRead() {
auto buffer = AlignedBuffer::allocate<char>(
std::min<uint64_t>(fileSize_, kMaxReadBufferSize), &pool_);
input_ = std::make_unique<SpillInput>(std::move(file), std::move(buffer));
} else {
std::unique_ptr<ReadFile> =
std::make_unique<HeapMemoryReadFile>(heapMemoryMock_);
} else if (toWhere_ == TO_HEAP) {
auto file = std::make_unique<HeapMemoryReadFile>(heapMemoryMock_);
auto buffer = AlignedBuffer::allocate<char>(
std::min<uint64_t>(fileSize_, kMaxReadBufferSize), &pool_);
input_ = std::make_unique<SpillInput>(std::move(file), std::move(buffer));
} else {
VELOX_FAIL("invalid spill destination");
}
}

Expand Down

0 comments on commit 2d03b05

Please sign in to comment.