diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-08-19 14:10:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-08-19 14:10:18 -0300 |
commit | c6cea857a4845940c833e39a149d20bb64a9af85 (patch) | |
tree | 9cae6b73bcd5be5fa7feb01130d903cb4dbf6d4e /lauxlib.c | |
parent | d61b0c60287c38008d312ddd11724a15b1737f7b (diff) | |
download | lua-c6cea857a4845940c833e39a149d20bb64a9af85.tar.gz lua-c6cea857a4845940c833e39a149d20bb64a9af85.tar.bz2 lua-c6cea857a4845940c833e39a149d20bb64a9af85.zip |
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.
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -526,7 +526,8 @@ static void newbox (lua_State *L) { | |||
526 | 526 | ||
527 | /* | 527 | /* |
528 | ** Compute new size for buffer 'B', enough to accommodate extra 'sz' | 528 | ** Compute new size for buffer 'B', enough to accommodate extra 'sz' |
529 | ** bytes. | 529 | ** bytes. (The test for "double is not big enough" also gets the |
530 | ** case when the multiplication by 2 overflows.) | ||
530 | */ | 531 | */ |
531 | static size_t newbuffsize (luaL_Buffer *B, size_t sz) { | 532 | static size_t newbuffsize (luaL_Buffer *B, size_t sz) { |
532 | size_t newsize = B->size * 2; /* double buffer size */ | 533 | size_t newsize = B->size * 2; /* double buffer size */ |
@@ -611,7 +612,7 @@ LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { | |||
611 | ** box (if existent) is not on the top of the stack. So, instead of | 612 | ** box (if existent) is not on the top of the stack. So, instead of |
612 | ** calling 'luaL_addlstring', it replicates the code using -2 as the | 613 | ** calling 'luaL_addlstring', it replicates the code using -2 as the |
613 | ** last argument to 'prepbuffsize', signaling that the box is (or will | 614 | ** last argument to 'prepbuffsize', signaling that the box is (or will |
614 | ** be) bellow the string being added to the buffer. (Box creation can | 615 | ** be) below the string being added to the buffer. (Box creation can |
615 | ** trigger an emergency GC, so we should not remove the string from the | 616 | ** trigger an emergency GC, so we should not remove the string from the |
616 | ** stack before we have the space guaranteed.) | 617 | ** stack before we have the space guaranteed.) |
617 | */ | 618 | */ |