Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions be/src/olap/rowset/segment_v2/bitshuffle_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ class BitShufflePageDecoder : public PageDecoder {
_cur_index(0) {}

~BitShufflePageDecoder() {
if (_chunk.size != 0) {
ChunkAllocator::instance()->free(_chunk);
}
ChunkAllocator::instance()->free(_chunk);
}

Status init() override {
Expand Down
6 changes: 3 additions & 3 deletions be/src/runtime/memory/chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace doris {
// will result in recompilation of all files. So, we put it in a
// file to keep this file simple and infrequently changed.
struct Chunk {
uint8_t* data;
size_t size;
int core_id;
uint8_t* data = nullptr;
size_t size = 0;
int core_id = -1;
};

} // namespace doris
4 changes: 3 additions & 1 deletion be/src/runtime/memory/chunk_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ bool ChunkAllocator::allocate(size_t size, Chunk* chunk) {
}

void ChunkAllocator::free(const Chunk& chunk) {
if (chunk.core_id == -1) {
return;
}
int64_t old_reserved_bytes = _reserved_bytes;
int64_t new_reserved_bytes = 0;
do {
Expand All @@ -190,7 +193,6 @@ void ChunkAllocator::free(const Chunk& chunk) {
_arenas[chunk.core_id]->push_free_chunk(chunk.data, chunk.size);
}


bool ChunkAllocator::allocate_align(size_t size, Chunk* chunk) {
return allocate(BitUtil::RoundUpToPowerOfTwo(size), chunk);
}
Expand Down