diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-09-25 10:49:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-09-25 10:49:29 -0300 |
commit | fbaf040f5effae90214887d10bfac710b836f281 (patch) | |
tree | fcf25185e1bb29d27ea22f82489f70e76547c67d | |
parent | e51564d1bee5aa8b411328d7d3d75906dfc0a260 (diff) | |
download | lua-fbaf040f5effae90214887d10bfac710b836f281.tar.gz lua-fbaf040f5effae90214887d10bfac710b836f281.tar.bz2 lua-fbaf040f5effae90214887d10bfac710b836f281.zip |
Details in the manual
-rw-r--r-- | manual/manual.of | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/manual/manual.of b/manual/manual.of index ff891399..8b34b5bd 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -2441,7 +2441,8 @@ to ensure that the stack has enough space for pushing new elements. | |||
2441 | 2441 | ||
2442 | Whenever Lua calls C, | 2442 | Whenever Lua calls C, |
2443 | it ensures that the stack has space for | 2443 | it ensures that the stack has space for |
2444 | at least @defid{LUA_MINSTACK} extra slots. | 2444 | at least @defid{LUA_MINSTACK} extra elements; |
2445 | that is, you can safely push up to @id{LUA_MINSTACK} values into it. | ||
2445 | @id{LUA_MINSTACK} is defined as 20, | 2446 | @id{LUA_MINSTACK} is defined as 20, |
2446 | so that usually you do not have to worry about stack space | 2447 | so that usually you do not have to worry about stack space |
2447 | unless your code has loops pushing elements onto the stack. | 2448 | unless your code has loops pushing elements onto the stack. |
@@ -3061,7 +3062,7 @@ static int foo (lua_State *L) { | |||
3061 | @APIEntry{int lua_checkstack (lua_State *L, int n);| | 3062 | @APIEntry{int lua_checkstack (lua_State *L, int n);| |
3062 | @apii{0,0,-} | 3063 | @apii{0,0,-} |
3063 | 3064 | ||
3064 | Ensures that the stack has space for at least @id{n} extra slots, | 3065 | Ensures that the stack has space for at least @id{n} extra elements, |
3065 | that is, that you can safely push up to @id{n} values into it. | 3066 | that is, that you can safely push up to @id{n} values into it. |
3066 | It returns false if it cannot fulfill the request, | 3067 | It returns false if it cannot fulfill the request, |
3067 | either because it would cause the stack | 3068 | either because it would cause the stack |
@@ -3069,7 +3070,7 @@ to be greater than a fixed maximum size | |||
3069 | (typically at least several thousand elements) or | 3070 | (typically at least several thousand elements) or |
3070 | because it cannot allocate memory for the extra space. | 3071 | because it cannot allocate memory for the extra space. |
3071 | This function never shrinks the stack; | 3072 | This function never shrinks the stack; |
3072 | if the stack already has space for the extra slots, | 3073 | if the stack already has space for the extra elements, |
3073 | it is left unchanged. | 3074 | it is left unchanged. |
3074 | 3075 | ||
3075 | } | 3076 | } |
@@ -6313,9 +6314,11 @@ It may be the string @St{b} (only @x{binary chunk}s), | |||
6313 | or @St{bt} (both binary and text). | 6314 | or @St{bt} (both binary and text). |
6314 | The default is @St{bt}. | 6315 | The default is @St{bt}. |
6315 | 6316 | ||
6316 | Lua does not check the consistency of binary chunks. | 6317 | It is safe to load malformed binary chunks; |
6317 | Maliciously crafted binary chunks can crash | 6318 | @id{load} signals an appropriate error. |
6318 | the interpreter. | 6319 | However, |
6320 | Lua does not check the consistency of the code inside binary chunks; | ||
6321 | running maliciously crafted bytecode can crash the interpreter. | ||
6319 | 6322 | ||
6320 | } | 6323 | } |
6321 | 6324 | ||