浏览代码

Details in the manual

Roberto Ierusalimschy 4 年之前
父节点
当前提交
fbaf040f5e
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      manual/manual.of

+ 9 - 6
manual/manual.of

@@ -2441,7 +2441,8 @@ to ensure that the stack has enough space for pushing new elements.
 
 Whenever Lua calls C,
 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,
 so that usually you do not have to worry about stack space
 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);|
 @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.
 It returns false if it cannot fulfill the request,
 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
 because it cannot allocate memory for the extra space.
 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.
 
 }
@@ -6313,9 +6314,11 @@ It may be the string @St{b} (only @x{binary chunk}s),
 or @St{bt} (both binary and text).
 The default is @St{bt}.
 
-Lua does not check the consistency of binary chunks.
-Maliciously crafted binary chunks can crash
-the interpreter.
+It is safe to load malformed binary chunks;
+@id{load} signals an appropriate error.
+However,
+Lua does not check the consistency of the code inside binary chunks;
+running maliciously crafted bytecode can crash the interpreter.
 
 }