Skip to content
Open
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
12 changes: 10 additions & 2 deletions bolt/connectors/paimon/BoltMemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@

#include <paimon/memory/memory_pool.h>
#include "bolt/common/memory/MemoryPool.h"
#include "bolt/core/ExpressionEvaluator.h"

namespace bytedance::bolt::connector::paimon {

class BoltPaimonMemoryPool : public ::paimon::MemoryPool {
public:
explicit BoltPaimonMemoryPool(memory::MemoryPool* const pool)
: pool_(std::move(pool)) {}
explicit BoltPaimonMemoryPool(
memory::MemoryPool* const pool,
core::ExpressionEvaluator* const expressionEvaluator = nullptr)
: pool_(pool), expressionEvaluator_(expressionEvaluator) {}

memory::MemoryPool* getBoltPool() const {
return pool_;
}

core::ExpressionEvaluator* getExpressionEvaluator() const {
return expressionEvaluator_;
}

void* Malloc(uint64_t size, uint64_t alignment) override {
if (alignment == 0) {
return pool_->allocate(static_cast<int64_t>(size));
Expand Down Expand Up @@ -71,6 +78,7 @@ class BoltPaimonMemoryPool : public ::paimon::MemoryPool {

private:
memory::MemoryPool* const pool_;
core::ExpressionEvaluator* const expressionEvaluator_;
};

} // namespace bytedance::bolt::connector::paimon
Loading
Loading