From 53cbd15e4ede619e39d22ea0691317cbc18e2b83 Mon Sep 17 00:00:00 2001 From: Johnny Wang Date: Thu, 2 Feb 2023 13:59:24 +0800 Subject: [PATCH] optimize: avoid NYI in the get_string_buf function. TRACE --- (1/0) base.lua:192 -- NYI: return to lower frame at ffi.new --- lib/resty/core/base.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/resty/core/base.lua b/lib/resty/core/base.lua index 7a9c4f28f..bc50c3b30 100644 --- a/lib/resty/core/base.lua +++ b/lib/resty/core/base.lua @@ -190,7 +190,8 @@ end function _M.get_string_buf(size, must_alloc) -- ngx.log(ngx.ERR, "str buf size: ", str_buf_size) if size > str_buf_size or must_alloc then - return ffi_new(c_buf_type, size) + local buf = ffi_new(c_buf_type, size) + return buf end if not str_buf then