diff --git a/be/src/exprs/expr_context.cpp b/be/src/exprs/expr_context.cpp index b632e1b333..e3bb2a43b9 100644 --- a/be/src/exprs/expr_context.cpp +++ b/be/src/exprs/expr_context.cpp @@ -35,8 +35,7 @@ namespace doris { ExprContext::ExprContext(Expr* root) - : _fn_contexts_ptr(nullptr), - _root(root), + : _root(root), _is_clone(false), _prepared(false), _opened(false), @@ -102,7 +101,6 @@ int ExprContext::register_func(RuntimeState* state, int varargs_buffer_size) { _fn_contexts.push_back(FunctionContextImpl::create_context( state, _pool.get(), return_type, arg_types, varargs_buffer_size, false)); - _fn_contexts_ptr = &_fn_contexts[0]; return _fn_contexts.size() - 1; } @@ -116,7 +114,6 @@ Status ExprContext::clone(RuntimeState* state, ExprContext** new_ctx) { for (int i = 0; i < _fn_contexts.size(); ++i) { (*new_ctx)->_fn_contexts.push_back(_fn_contexts[i]->impl()->clone((*new_ctx)->_pool.get())); } - (*new_ctx)->_fn_contexts_ptr = &((*new_ctx)->_fn_contexts[0]); (*new_ctx)->_is_clone = true; (*new_ctx)->_prepared = true; @@ -136,7 +133,6 @@ Status ExprContext::clone(RuntimeState* state, ExprContext** new_ctx, Expr* root for (int i = 0; i < _fn_contexts.size(); ++i) { (*new_ctx)->_fn_contexts.push_back(_fn_contexts[i]->impl()->clone((*new_ctx)->_pool.get())); } - (*new_ctx)->_fn_contexts_ptr = &((*new_ctx)->_fn_contexts[0]); (*new_ctx)->_is_clone = true; (*new_ctx)->_prepared = true; diff --git a/be/src/exprs/expr_context.h b/be/src/exprs/expr_context.h index a6593e37bd..f556b0f305 100644 --- a/be/src/exprs/expr_context.h +++ b/be/src/exprs/expr_context.h @@ -165,11 +165,6 @@ private: /// and owned by this ExprContext. std::vector _fn_contexts; - /// Array access to fn_contexts_. Used by ScalarFnCall's codegen'd compute function - /// to access the correct FunctionContext. - /// TODO: revisit this - FunctionContext** _fn_contexts_ptr; - // Used to create _pool, if change to raw pointer later, be careful about tracker's life cycle. std::shared_ptr _mem_tracker; diff --git a/be/src/runtime/mem_pool.cpp b/be/src/runtime/mem_pool.cpp index fed5724c0c..e7de27e257 100644 --- a/be/src/runtime/mem_pool.cpp +++ b/be/src/runtime/mem_pool.cpp @@ -193,7 +193,7 @@ void MemPool::acquire_data(MemPool* src, bool keep_current) { } // insert new chunks after current_chunk_idx_ - auto insert_chunk = chunks_.begin() + current_chunk_idx_ + 1; + auto insert_chunk = chunks_.begin() + (current_chunk_idx_ + 1); chunks_.insert(insert_chunk, src->chunks_.begin(), end_chunk); src->chunks_.erase(src->chunks_.begin(), end_chunk); current_chunk_idx_ += num_acquired_chunks;