[bugfix and improvement]fix mem tracker for load and simplify some macros (#11125)

This commit is contained in:
Xinyi Zou
2022-07-22 21:59:36 +08:00
committed by GitHub
parent 65dd8eb885
commit ad31b6c902
13 changed files with 26 additions and 32 deletions

View File

@ -401,9 +401,8 @@ Status ExprContext::get_const_value(RuntimeState* state, Expr& expr, AnyVal** co
Status rst;
char* ptr_copy = reinterpret_cast<char*>(_pool->try_allocate(sv->len, &rst));
if (ptr_copy == nullptr) {
RETURN_LIMIT_EXCEEDED(
thread_context()->_thread_mem_tracker_mgr->limiter_mem_tracker(), state,
"Could not allocate constant string value", sv->len, rst);
RETURN_LIMIT_EXCEEDED(state, "Could not allocate constant string value", sv->len,
rst);
}
memcpy(ptr_copy, sv->ptr, sv->len);
sv->ptr = reinterpret_cast<uint8_t*>(ptr_copy);