[to #41932470] fix memory of udf

This commit is contained in:
obdev
2023-02-06 23:45:36 +08:00
committed by ob-robot
parent ec4fd2244f
commit 9b302b8660
11 changed files with 96 additions and 99 deletions

View File

@ -282,15 +282,16 @@ int ObExecContext::init_phy_op(const uint64_t phy_op_size)
return ret;
}
int ObExecContext::init_expr_op(uint64_t expr_op_size)
int ObExecContext::init_expr_op(uint64_t expr_op_size, ObIAllocator *allocator)
{
int ret = OB_SUCCESS;
ObIAllocator &real_alloc = allocator != NULL ? *allocator : allocator_;
if (OB_UNLIKELY(expr_op_size_ > 0)) {
ret = OB_INIT_TWICE;
LOG_WARN("init exec ctx twice", K(ret), K_(expr_op_size));
} else if (expr_op_size > 0) {
int64_t ctx_store_size = static_cast<int64_t>(expr_op_size * sizeof(ObExprOperatorCtx *));
if (OB_ISNULL(expr_op_ctx_store_ = static_cast<ObExprOperatorCtx **>(allocator_.alloc(ctx_store_size)))) {
if (OB_ISNULL(expr_op_ctx_store_ = static_cast<ObExprOperatorCtx **>(real_alloc.alloc(ctx_store_size)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("fail to alloc expr_op_ctx_store_ memory", K(ret), K(ctx_store_size));
} else {