diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-28 17:11:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-28 17:11:33 -0300 |
| commit | 86a8e74824b3ec7918e3dbeaff222bb1ea1ec22f (patch) | |
| tree | 222fc019433674ef77166aae182cb93b2fa2710f | |
| parent | 9fa63a62682c1353eeabd4575152941fa6f3e70f (diff) | |
| download | lua-86a8e74824b3ec7918e3dbeaff222bb1ea1ec22f.tar.gz lua-86a8e74824b3ec7918e3dbeaff222bb1ea1ec22f.tar.bz2 lua-86a8e74824b3ec7918e3dbeaff222bb1ea1ec22f.zip | |
Details
| -rw-r--r-- | lgc.c | 3 | ||||
| -rw-r--r-- | manual/manual.of | 14 |
2 files changed, 10 insertions, 7 deletions
| @@ -1055,7 +1055,6 @@ static void setpause (global_State *g) { | |||
| 1055 | l_obj threshold = applygcparam(g, PAUSE, g->marked); | 1055 | l_obj threshold = applygcparam(g, PAUSE, g->marked); |
| 1056 | l_obj debt = threshold - gettotalobjs(g); | 1056 | l_obj debt = threshold - gettotalobjs(g); |
| 1057 | if (debt < 0) debt = 0; | 1057 | if (debt < 0) debt = 0; |
| 1058 | //printf("pause: %ld %ld\n", debt, g->marked); | ||
| 1059 | luaE_setdebt(g, debt); | 1058 | luaE_setdebt(g, debt); |
| 1060 | } | 1059 | } |
| 1061 | 1060 | ||
| @@ -1261,7 +1260,6 @@ static void minor2inc (lua_State *L, global_State *g, int kind) { | |||
| 1261 | static int checkminormajor (global_State *g, l_obj addedold1) { | 1260 | static int checkminormajor (global_State *g, l_obj addedold1) { |
| 1262 | l_obj step = applygcparam(g, MINORMUL, g->GCmajorminor); | 1261 | l_obj step = applygcparam(g, MINORMUL, g->GCmajorminor); |
| 1263 | l_obj limit = applygcparam(g, MINORMAJOR, g->GCmajorminor); | 1262 | l_obj limit = applygcparam(g, MINORMAJOR, g->GCmajorminor); |
| 1264 | //printf("-> (%ld) major? marked: %ld limit: %ld step: %ld addedold1: %ld)\n", gettotalobjs(g), g->marked, limit, step, addedold1); | ||
| 1265 | return (addedold1 >= (step >> 1) || g->marked >= limit); | 1263 | return (addedold1 >= (step >> 1) || g->marked >= limit); |
| 1266 | } | 1264 | } |
| 1267 | 1265 | ||
| @@ -1410,7 +1408,6 @@ static int checkmajorminor (lua_State *L, global_State *g) { | |||
| 1410 | l_obj addedobjs = numobjs - g->GCmajorminor; | 1408 | l_obj addedobjs = numobjs - g->GCmajorminor; |
| 1411 | l_obj limit = applygcparam(g, MAJORMINOR, addedobjs); | 1409 | l_obj limit = applygcparam(g, MAJORMINOR, addedobjs); |
| 1412 | l_obj tobecollected = numobjs - g->marked; | 1410 | l_obj tobecollected = numobjs - g->marked; |
| 1413 | //printf("(%ld) -> minor? tobecollected: %ld limit: %ld\n", numobjs, tobecollected, limit); | ||
| 1414 | if (tobecollected > limit) { | 1411 | if (tobecollected > limit) { |
| 1415 | atomic2gen(L, g); /* return to generational mode */ | 1412 | atomic2gen(L, g); /* return to generational mode */ |
| 1416 | setminordebt(g); | 1413 | setminordebt(g); |
diff --git a/manual/manual.of b/manual/manual.of index 3181549d..7df32fcf 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -3672,12 +3672,13 @@ will contain the chunk until everything created by the chunk has | |||
| 3672 | been collected; | 3672 | been collected; |
| 3673 | therefore, Lua can avoid copying to internal structures | 3673 | therefore, Lua can avoid copying to internal structures |
| 3674 | some parts of the chunk. | 3674 | some parts of the chunk. |
| 3675 | (In general, a fixed buffer would keep the chunk | 3675 | (In general, a fixed buffer would keep its contents |
| 3676 | as its contents until the end of the program, | 3676 | until the end of the program, |
| 3677 | for instance with the chunk in ROM.) | 3677 | for instance with the chunk in ROM.) |
| 3678 | Moreover, for a fixed buffer, | 3678 | Moreover, for a fixed buffer, |
| 3679 | the reader function should return the entire chunk in the first read. | 3679 | the reader function should return the entire chunk in the first read. |
| 3680 | (As an example, @Lid{luaL_loadbufferx} does that.) | 3680 | (As an example, @Lid{luaL_loadbufferx} does that, |
| 3681 | which means that you can use it to load fixed buffers.) | ||
| 3681 | 3682 | ||
| 3682 | The function @Lid{lua_load} fully preserves the Lua stack | 3683 | The function @Lid{lua_load} fully preserves the Lua stack |
| 3683 | through the calls to the reader function, | 3684 | through the calls to the reader function, |
| @@ -3936,7 +3937,7 @@ This function is equivalent to @Lid{lua_pushcclosure} with no upvalues. | |||
| 3936 | 3937 | ||
| 3937 | Creates an @emphx{external string}, | 3938 | Creates an @emphx{external string}, |
| 3938 | that is, a string that uses memory not managed by Lua. | 3939 | that is, a string that uses memory not managed by Lua. |
| 3939 | The pointer @id{s} points to the exernal buffer | 3940 | The pointer @id{s} points to the external buffer |
| 3940 | holding the string content, | 3941 | holding the string content, |
| 3941 | and @id{len} is the length of the string. | 3942 | and @id{len} is the length of the string. |
| 3942 | The string should have a zero at its end, | 3943 | The string should have a zero at its end, |
| @@ -9362,6 +9363,11 @@ it is equivalent to @Lid{lua_closethread} with | |||
| 9362 | } | 9363 | } |
| 9363 | 9364 | ||
| 9364 | @item{ | 9365 | @item{ |
| 9366 | The function @id{lua_setcstacklimit} is deprecated. | ||
| 9367 | Calls to it can simply be removed. | ||
| 9368 | } | ||
| 9369 | |||
| 9370 | @item{ | ||
| 9365 | The function @Lid{lua_dump} changed the way it keeps the stack | 9371 | The function @Lid{lua_dump} changed the way it keeps the stack |
| 9366 | through the calls to the writer function. | 9372 | through the calls to the writer function. |
| 9367 | (That was not specified in previous versions.) | 9373 | (That was not specified in previous versions.) |
