From c6cea857a4845940c833e39a149d20bb64a9af85 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 19 Aug 2022 14:10:18 -0300 Subject: Better documentation for 'multires' expressions Manual has a new section explaining multires expressions, lists of expressions, and adjustments. This commit also corrects some comments in the code. --- lauxlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index 8ed1da11..413d8f97 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -526,7 +526,8 @@ static void newbox (lua_State *L) { /* ** Compute new size for buffer 'B', enough to accommodate extra 'sz' -** bytes. +** bytes. (The test for "double is not big enough" also gets the +** case when the multiplication by 2 overflows.) */ static size_t newbuffsize (luaL_Buffer *B, size_t sz) { size_t newsize = B->size * 2; /* double buffer size */ @@ -611,7 +612,7 @@ LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { ** box (if existent) is not on the top of the stack. So, instead of ** calling 'luaL_addlstring', it replicates the code using -2 as the ** last argument to 'prepbuffsize', signaling that the box is (or will -** be) bellow the string being added to the buffer. (Box creation can +** be) below the string being added to the buffer. (Box creation can ** trigger an emergency GC, so we should not remove the string from the ** stack before we have the space guaranteed.) */ -- cgit v1.2.3-55-g6feb