aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-14 11:41:57 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-14 11:41:57 -0300
commit4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5 (patch)
tree474a56c1cbb1b109f945cb3765c6ebc918d35b37 /manual
parentad73b332240ef5b9bab1517517f63a1425dc7545 (diff)
downloadlua-4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5.tar.gz
lua-4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5.tar.bz2
lua-4eda1acafa1a69224b2d4f786cf1ec8f7a4d9ac5.zip
Cleaner protocol between 'lua_dump' and writer function
'lua_dump' signals to the writer function the end of a dump, so that is has more freedom when using the stack.
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of21
1 files changed, 19 insertions, 2 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 8607e57d..ef1bdfd2 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -3266,6 +3266,13 @@ As it produces parts of the chunk,
3266with the given @id{data} 3266with the given @id{data}
3267to write them. 3267to write them.
3268 3268
3269The function @Lid{lua_dump} fully preserves the Lua stack
3270through the calls to the writer function,
3271except that it may push some values for internal use
3272before the first call,
3273and it restores the stack size to its original size
3274after the last call.
3275
3269If @id{strip} is true, 3276If @id{strip} is true,
3270the binary representation may not include all debug information 3277the binary representation may not include all debug information
3271about the function, 3278about the function,
@@ -3275,8 +3282,6 @@ The value returned is the error code returned by the last
3275call to the writer; 3282call to the writer;
3276@N{0 means} no errors. 3283@N{0 means} no errors.
3277 3284
3278This function does not pop the Lua function from the stack.
3279
3280} 3285}
3281 3286
3282@APIEntry{int lua_error (lua_State *L);| 3287@APIEntry{int lua_error (lua_State *L);|
@@ -4688,6 +4693,10 @@ passing along the buffer to be written (@id{p}),
4688its size (@id{sz}), 4693its size (@id{sz}),
4689and the @id{ud} parameter supplied to @Lid{lua_dump}. 4694and the @id{ud} parameter supplied to @Lid{lua_dump}.
4690 4695
4696After @Lid{lua_dump} writes its last piece,
4697it will signal that by calling the writer function one more time,
4698with a @id{NULL} buffer (and size 0).
4699
4691The writer returns an error code: 4700The writer returns an error code:
4692@N{0 means} no errors; 4701@N{0 means} no errors;
4693any other value means an error and stops @Lid{lua_dump} from 4702any other value means an error and stops @Lid{lua_dump} from
@@ -9260,6 +9269,14 @@ it is equivalent to @Lid{lua_closethread} with
9260} 9269}
9261 9270
9262@item{ 9271@item{
9272The function @Lid{lua_dump} changed the way it keeps the stack
9273through the calls to the writer function.
9274(That was not specified in previous versions.)
9275Also, it calls the writer function one extra time,
9276to signal the end of the dump.
9277}
9278
9279@item{
9263There were several changes in the parameters 9280There were several changes in the parameters
9264for the options @Lid{LUA_GCINC} and @Lid{LUA_GCGEN} 9281for the options @Lid{LUA_GCINC} and @Lid{LUA_GCGEN}
9265of the function @Lid{lua_gc}. 9282of the function @Lid{lua_gc}.