Lua diffs-lua-5.4.0-alpha-rc1-rc2


README

2c2
< This is Lua 5.4.0 (alpha), released on 29 May 2019.
> This is Lua 5.4.0 (alpha), released on 06 Jun 2019.

doc/contents.html

175a176
> <A HREF="manual.html#pdf-coroutine.close">coroutine.close</A><BR>

178d178
< <A HREF="manual.html#pdf-coroutine.kill">coroutine.kill</A><BR>

626c626
< Wed May 29 08:06:44 -03 2019
> Wed Jun  5 21:27:06 -03 2019

doc/manual.html

784,796c784
< the <em>major multiplier</em> and the <em>the minor multiplier</em>.
< 
< 
< <p>
< The major multiplier controls the frequency of major collections.
< For a major multiplier <em>x</em>,
< a new major collection will be done when memory
< grows <em>x%</em> larger than the memory in use after the previous major
< collection.
< For instance, for a multiplier of 100,
< the collector will do a major collection when the use of memory
< gets larger than twice the use after the previous collection.
< The default value is 100; the maximum value is 1000.
> the <em>minor multiplier</em> and the <em>the major multiplier</em>.

810a799,810
> <p>
> The major multiplier controls the frequency of major collections.
> For a major multiplier <em>x</em>,
> a new major collection will be done when memory
> grows <em>x%</em> larger than the memory in use after the previous major
> collection.
> For instance, for a multiplier of 100,
> the collector will do a major collection when the use of memory
> gets larger than twice the use after the previous collection.
> The default value is 100; the maximum value is 1000.
> 
> 

1064c1064
< the function also kills the coroutine (see <a href="#pdf-coroutine.kill"><code>coroutine.kill</code></a>).
> the function also closes the coroutine (see <a href="#pdf-coroutine.close"><code>coroutine.close</code></a>).

1842c1842
< and <code>toclose</code>, wich declares a to-be-closed variable (see <a href="#3.3.8">&sect;3.3.8</a>).
> and <code>toclose</code>, which declares a to-be-closed variable (see <a href="#3.3.8">&sect;3.3.8</a>).

1887a1888,1890
> 
> 
> <p>

1892a1896,1900
> After an error,
> other errors in closing methods
> interrupt the respective method,
> but are otherwise ignored;
> the error reported is the original one.

1898c1906
< and therefore they will not be closed.
> and therefore they will never be closed.

1902,1904c1910,1913
< You should either use finalizers
< or call <a href="#pdf-coroutine.kill"><code>coroutine.kill</code></a> to close the variables in these cases.
< However, note that if the coroutine was created
> In both cases,
> you should either use finalizers
> or call <a href="#pdf-coroutine.close"><code>coroutine.close</code></a> to close the variables.
> However, if the coroutine was created

1906c1915
< then its corresponding function will close all variables
> then its corresponding function will close the coroutine

3679c3688
< <pre>int lua_gc (lua_State *L, int what, int data);</pre>
> <pre>int lua_gc (lua_State *L, int what, ...);</pre>

3687c3696,3698
< according to the value of the parameter <code>what</code>:
> according to the value of the parameter <code>what</code>.
> For options that need extra arguments,
> they are listed after the option.

3691,3692c3702,3703
< <li><b><code>LUA_GCSTOP</code>: </b>
< stops the garbage collector.
> <li><b><code>LUA_GCCOLLECT</code>: </b>
> Performs a full garbage-collection cycle.

3695,3696c3706,3707
< <li><b><code>LUA_GCRESTART</code>: </b>
< restarts the garbage collector.
> <li><b><code>LUA_GCSTOP</code>: </b>
> Stops the garbage collector.

3699,3700c3710,3711
< <li><b><code>LUA_GCCOLLECT</code>: </b>
< performs a full garbage-collection cycle.
> <li><b><code>LUA_GCRESTART</code>: </b>
> Restarts the garbage collector.

3704c3715
< returns the current amount of memory (in Kbytes) in use by Lua.
> Returns the current amount of memory (in Kbytes) in use by Lua.

3708c3719
< returns the remainder of dividing the current amount of bytes of
> Returns the remainder of dividing the current amount of bytes of

3712,3713c3723,3725
< <li><b><code>LUA_GCSTEP</code>: </b>
< performs an incremental step of garbage collection.
> <li><b><code>LUA_GCSTEP</code> <code>(int stepsize)</code>: </b>
> Performs an incremental step of garbage collection,
> corresponding to the allocation of <code>stepsize</code> Kbytes.

3716,3719c3728,3730
< <li><b><code>LUA_GCSETPAUSE</code>: </b>
< sets <code>data</code> as the new value
< for the <em>pause</em> of the collector (see <a href="#2.5">&sect;2.5</a>)
< and returns the previous value of the pause.
> <li><b><code>LUA_GCISRUNNING</code>: </b>
> Returns a boolean that tells whether the collector is running
> (i.e., not stopped).

3722,3725c3733,3736
< <li><b><code>LUA_GCSETSTEPMUL</code>: </b>
< sets <code>data</code> as the new value for the <em>step multiplier</em> of
< the collector (see <a href="#2.5">&sect;2.5</a>)
< and returns the previous value of the step multiplier.
> <li><b><code>LUA_GCINC</code> (int pause, int stepmul, stepsize): </b>
> Changes the collector to incremental mode
> with the given parameters (see <a href="#2.5.1">&sect;2.5.1</a>).
> Returns the previous mode (<code>LUA_GCGEN</code> or <code>LUA_GCINC</code>).

3728,3730c3739,3742
< <li><b><code>LUA_GCISRUNNING</code>: </b>
< returns a boolean that tells whether the collector is running
< (i.e., not stopped).
> <li><b><code>LUA_GCGEN</code> (int minormul, int majormul): </b>
> Changes the collector to generational mode
> with the given parameters (see <a href="#2.5.2">&sect;2.5.2</a>).
> Returns the previous mode (<code>LUA_GCGEN</code> or <code>LUA_GCINC</code>).

4257d4268
< There is no explicit function to close or to destroy a thread.

4941c4952
< leave the error object on the stack,
> leaves the error object on the top of the stack,

7589c7600
< performs a full garbage-collection cycle.
> Performs a full garbage-collection cycle.

7594c7605
< stops automatic execution of the garbage collector.
> Stops automatic execution of the garbage collector.

7600c7611
< restarts automatic execution of the garbage collector.
> Restarts automatic execution of the garbage collector.

7604c7615
< returns the total memory in use by Lua in Kbytes.
> Returns the total memory in use by Lua in Kbytes.

7611c7622
< performs a garbage-collection step.
> Performs a garbage-collection step.

7617c7628
< (in KBytes) had been allocated by Lua.
> (in Kbytes) had been allocated by Lua.

7621,7624c7632,7634
< <li><b>"<code>setpause</code>": </b>
< sets <code>arg</code> as the new value for the <em>pause</em> of
< the collector (see <a href="#2.5">&sect;2.5</a>).
< Returns the previous value for <em>pause</em>.
> <li><b>"<code>isrunning</code>": </b>
> Returns a boolean that tells whether the collector is running
> (i.e., not stopped).

7632c7642
< and the step size.
> and the step size (see <a href="#2.5.1">&sect;2.5.1</a>).

7640c7650
< and the major multiplier.
> and the major multiplier (see <a href="#2.5.2">&sect;2.5.2</a>).

7644,7648d7653
< <li><b>"<code>isrunning</code>": </b>
< returns a boolean that tells whether the collector is running
< (i.e., not stopped).
< </li>
< 

8079c8084
< <hr><h3><a name="pdf-warn"><code>warn (message [, tocont])</code></a></h3>
> <hr><h3><a name="pdf-warn"><code>warn (msg1, &middot;&middot;&middot;)</code></a></h3>

8083,8086c8088,8089
< Emits a warning with the given message.
< A message in a call with <code>tocont</code> true should be
< continued in another call to this function.
< The default for <code>tocont</code> is false.
> Emits a warning with a message composed by the concatenation
> of all its arguments (which should be strings).

8113a8117,8133
> <hr><h3><a name="pdf-coroutine.close"><code>coroutine.close (co)</code></a></h3>
> 
> 
> <p>
> Closes coroutine <code>co</code>,
> that is,
> closes all its pending to-be-closed variables
> and puts the coroutine in a dead state.
> The given coroutine must be dead or suspended.
> In case of error closing some variable,
> returns <b>false</b> plus the error object;
> otherwise returns <b>true</b>.
> 
> 
> 
> 
> <p>

8143,8157d8162
< <hr><h3><a name="pdf-coroutine.kill"><code>coroutine.kill (co)</code></a></h3>
< 
< 
< <p>
< Kills coroutine <code>co</code>,
< closing all its pending to-be-closed variables
< and putting the coroutine in a dead state.
< In case of error closing some variable,
< returns <b>false</b> plus the error object;
< otherwise returns <b>true</b>.
< 
< 
< 
< 
< <p>

8202c8207,8208
< if the coroutine is running (that is, it called <code>status</code>);
> if the coroutine is running
> (that is, it is the one that called <code>status</code>);

8226c8232
< the function kills the coroutine and propagates the error.
> the function closes the coroutine and propagates the error.

11398a11405,11410
> <li>
> The options "<code>setpause</code>" and "<code>setstepmul</code>"
> of the function <a href="#pdf-collectgarbage"><code>collectgarbage</code></a> are deprecated.
> You should use the new option "<code>incremental</code>" to set them.
> </li>
> 

11447a11460,11465
> <li>
> The options <code>LUA_GCSETPAUSE</code> and <code>LUA_GCSETSTEPMUL</code>
> of the function <a href="#lua_gc"><code>lua_gc</code></a> are deprecated.
> You should use the new option <code>LUA_GCINC</code> to set them.
> </li>
> 

11547c11565
< Wed May 29 08:06:33 -03 2019
> Thu Jun  6 15:59:35 -03 2019

doc/readme.html

280,281c280,281
< <LI> new functions 'lua_resetthread' and 'coroutine.kill'
< <LI> coersions string->number moved to the string library
> <LI> new functions 'lua_resetthread' and 'coroutine.close'
> <LI> coersions string-to-number moved to the string library

332c332
< Wed May 29 16:02:01 BRT 2019
> Thu Jun  6 10:58:49 -03 2019

src/lbaselib.c

39a40,44
> /*
> ** Creates a warning with all given arguments.
> ** Check first for errors; otherwise an error may interrupt
> ** the composition of a warning, leaving it unfinished.
> */

41,42c46,53
<   const char *msg = luaL_checkstring(L, 1);
<   lua_warning(L, msg, lua_toboolean(L, 2));
>   int n = lua_gettop(L);  /* number of arguments */
>   int i;
>   luaL_checkstring(L, 1);  /* at least one argument */
>   for (i = 2; i <= n; i++)
>     luaL_checkstring(L, i);  /* make sure all arguments are strings */
>   for (i = 1; i <= n; i++)  /* compose warning */
>     lua_warning(L, lua_tostring(L, i), 1);
>   lua_warning(L, "", 0);  /* close warning */

src/lcorolib.c

78,82c78,79
<     if (stat != LUA_OK && stat != LUA_YIELD) {
<       stat = lua_resetthread(co);  /* close variables in case of errors */
<       if (stat != LUA_OK)  /* error closing variables? */
<         lua_xmove(co, L, 1);  /* get new error object */
<     }
>     if (stat != LUA_OK && stat != LUA_YIELD)
>       lua_resetthread(co);  /* close variables in case of errors */

168c165
< static int luaB_kill (lua_State *L) {
> static int luaB_close (lua_State *L) {

185c182
<       return luaL_error(L, "cannot kill a %s coroutine", statname[status]);
>       return luaL_error(L, "cannot close a %s coroutine", statname[status]);

198c195
<   {"kill", luaB_kill},
>   {"close", luaB_close},

src/ldebug.c

375a376
>         break;

528,529c529,530
<  const char *getobjname (const Proto *p, int lastpc, int reg,
<                          const char **name) {
> static const char *getobjname (const Proto *p, int lastpc, int reg,
>                                const char **name) {

src/lfunc.c

147c147,148
<   else {  /* there was an error */
>   else {  /* must close the object in protected mode */
>     ptrdiff_t oldtop = savestack(L, level + 1);

151,152c152,153
<       int newstatus = luaD_pcall(L, callclose, NULL, savestack(L, level), 0);
<       if (newstatus != LUA_OK)  /* another error when closing? */
>       int newstatus = luaD_pcall(L, callclose, NULL, oldtop, 0);
>       if (newstatus != LUA_OK && status == CLOSEPROTECT)  /* first error? */

153a155,156
>       else  /* leave original error (or nil) on top */
>         L->top = restorestack(L, oldtop);

src/lgc.c

487,488c487,488
<       ((weakkey = strchr(svalue(mode), 'k')),
<        (weakvalue = strchr(svalue(mode), 'v')),
>       (cast_void(weakkey = strchr(svalue(mode), 'k')),
>        cast_void(weakvalue = strchr(svalue(mode), 'v')),

src/llex.c

32c32
< #define next(ls) (ls->current = zgetc(ls->z))
> #define next(ls)	(ls->current = zgetc(ls->z))

340c340
<   while ((save_and_next(ls), lisxdigit(ls->current))) {
>   while (cast_void(save_and_next(ls)), lisxdigit(ls->current)) {

src/lobject.c

369,370c369,370
< static size_t tostringbuff (TValue *obj, char *buff) {
<   size_t len;
> static int tostringbuff (TValue *obj, char *buff) {
>   int len;

390c390
<   size_t len = tostringbuff(obj, buff);
>   int len = tostringbuff(obj, buff);

442c442
< ** space, empty it. 'sz' must fit in an empty space.
> ** space, empty it. 'sz' must fit in an empty buffer.

444c444
< static char *getbuff (BuffFS *buff, size_t sz) {
> static char *getbuff (BuffFS *buff, int sz) {

446c446
<   if (sz > BUFVFS - cast_sizet(buff->blen))  /* string does not fit? */
>   if (sz > BUFVFS - buff->blen)  /* not enough space? */

461c461
<     char *bf = getbuff(buff, slen);
>     char *bf = getbuff(buff, cast_int(slen));

463c463
<     addsize(buff, slen);
>     addsize(buff, cast_int(slen));

477c477
<   size_t len = tostringbuff(num, numbuff);  /* format number into 'numbuff' */
>   int len = tostringbuff(num, numbuff);  /* format number into 'numbuff' */

src/lstring.c

124,125c124,125
<     if (iswhite(g->strcache[i][j]))  /* will entry be collected? */
<       g->strcache[i][j] = g->memerrmsg;  /* replace it with something fixed */
>       if (iswhite(g->strcache[i][j]))  /* will entry be collected? */
>         g->strcache[i][j] = g->memerrmsg;  /* replace it with something fixed */

src/ltablib.c

309c309
<     while (lua_geti(L, 1, --j), sort_comp(L, -3, -1)) {
>     while ((void)lua_geti(L, 1, --j), sort_comp(L, -3, -1)) {

src/lvm.c

1154c1154
<             ? (n = ivalue(rc), luaV_fastgeti(L, rb, n, slot))
>             ? (cast_void(n = ivalue(rc)), luaV_fastgeti(L, rb, n, slot))

1207c1207
<             ? (n = ivalue(rb), luaV_fastgeti(L, s2v(ra), n, slot))
>             ? (cast_void(n = ivalue(rb)), luaV_fastgeti(L, s2v(ra), n, slot))

1595a1596
>           luaF_close(L, base, LUA_OK);  /* there may be open upvalues */

1598d1598
<           luaF_close(L, base, LUA_OK);  /* there may be open upvalues */