From b278106336e98d3600d7721e31d289ba8c1c769c Mon Sep 17 00:00:00 2001 From: puXiaoyi <465577676@qq.com> Date: Thu, 14 Jul 2016 13:49:06 +0800 Subject: [PATCH] fix comment for lpushbuffer The size of first chunk ([2]) is 16 struct buffer_node, and the second size is 32 ... --- lualib-src/lua-socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lualib-src/lua-socket.c b/lualib-src/lua-socket.c index bc49e568..ecaa2fcb 100644 --- a/lualib-src/lua-socket.c +++ b/lualib-src/lua-socket.c @@ -87,8 +87,8 @@ lnewbuffer(lua_State *L) { Comment: The table pool record all the buffers chunk, and the first index [1] is a lightuserdata : free_node. We can always use this pointer for struct buffer_node . The following ([2] ...) userdatas in table pool is the buffer chunk (for struct buffer_node), - we never free them until the VM closed. The size of first chunk ([2]) is 8 struct buffer_node, - and the second size is 16 ... The largest size of chunk is LARGE_PAGE_NODE (4096) + we never free them until the VM closed. The size of first chunk ([2]) is 16 struct buffer_node, + and the second size is 32 ... The largest size of chunk is LARGE_PAGE_NODE (4096) lpushbbuffer will get a free struct buffer_node from table pool, and then put the msg/size in it. lpopbuffer return the struct buffer_node back to table pool (By calling return_free_node).