Skip to content

Commit

Permalink
optimize: avoid NYI in the get_string_buf function.
Browse files Browse the repository at this point in the history
TRACE --- (1/0) base.lua:192 -- NYI: return to lower frame at ffi.new
  • Loading branch information
xiaocang committed Feb 2, 2023
1 parent f0ca455 commit 53cbd15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/resty/core/base.lua
Expand Up @@ -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
Expand Down

0 comments on commit 53cbd15

Please sign in to comment.