From 3d838f635cc81ec3332f9a904992db1c6d8a46ad Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 27 Jul 2018 15:50:53 -0300 Subject: Added "emergency collection" to 'io.tmpfile' and 'os.tmpname' These operations also can give errors for lack of resources, so they also will try "emergency collections" in case of resource errors. Because there are now two libraries with that kind of handling, 'resourcetryagain' was moved to the auxiliary library to be shared by the libraries. --- manual/manual.of | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'manual') diff --git a/manual/manual.of b/manual/manual.of index 659daa55..5a8b1b2c 100644 --- a/manual/manual.of +++ b/manual/manual.of @@ -5538,6 +5538,20 @@ Leaves a copy of the module on the stack. } +@APIEntry{int luaL_resourcetryagain (lua_State *L);| +@apii{0,0,m} + +Try to release resources in case of errors. +This function uses @id{errno} to check whether the last error was +related to lack of resources (e.g., not enough memory or too many +open files). +If so, the function performs a full garbage collection +to try to release resources, and then it returns 1 to signal to +the caller that it is worth trying again the failed operation. +Otherwise, it returns 0. + +} + @APIEntry{void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);| @apii{nup,0,m} -- cgit v1.2.3-55-g6feb