Details in the manual

This commit is contained in:
Roberto Ierusalimschy 2020-09-25 10:49:29 -03:00
parent e51564d1be
commit fbaf040f5e
1 changed files with 9 additions and 6 deletions

View File

@ -2441,7 +2441,8 @@ to ensure that the stack has enough space for pushing new elements.
Whenever Lua calls C, Whenever Lua calls C,
it ensures that the stack has space for it ensures that the stack has space for
at least @defid{LUA_MINSTACK} extra slots. at least @defid{LUA_MINSTACK} extra elements;
that is, you can safely push up to @id{LUA_MINSTACK} values into it.
@id{LUA_MINSTACK} is defined as 20, @id{LUA_MINSTACK} is defined as 20,
so that usually you do not have to worry about stack space so that usually you do not have to worry about stack space
unless your code has loops pushing elements onto the stack. unless your code has loops pushing elements onto the stack.
@ -3061,7 +3062,7 @@ static int foo (lua_State *L) {
@APIEntry{int lua_checkstack (lua_State *L, int n);| @APIEntry{int lua_checkstack (lua_State *L, int n);|
@apii{0,0,-} @apii{0,0,-}
Ensures that the stack has space for at least @id{n} extra slots, Ensures that the stack has space for at least @id{n} extra elements,
that is, that you can safely push up to @id{n} values into it. that is, that you can safely push up to @id{n} values into it.
It returns false if it cannot fulfill the request, It returns false if it cannot fulfill the request,
either because it would cause the stack either because it would cause the stack
@ -3069,7 +3070,7 @@ to be greater than a fixed maximum size
(typically at least several thousand elements) or (typically at least several thousand elements) or
because it cannot allocate memory for the extra space. because it cannot allocate memory for the extra space.
This function never shrinks the stack; This function never shrinks the stack;
if the stack already has space for the extra slots, if the stack already has space for the extra elements,
it is left unchanged. it is left unchanged.
} }
@ -6313,9 +6314,11 @@ It may be the string @St{b} (only @x{binary chunk}s),
or @St{bt} (both binary and text). or @St{bt} (both binary and text).
The default is @St{bt}. The default is @St{bt}.
Lua does not check the consistency of binary chunks. It is safe to load malformed binary chunks;
Maliciously crafted binary chunks can crash @id{load} signals an appropriate error.
the interpreter. However,
Lua does not check the consistency of the code inside binary chunks;
running maliciously crafted bytecode can crash the interpreter.
} }