diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-23 17:29:03 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-23 17:29:03 -0300 |
| commit | ec61be9a7e828bfa366a35658b90f53b1ce39478 (patch) | |
| tree | 58ca7e26ac48fcbf26136efc2c72e30980f87e40 /ltests.c | |
| parent | f356d5acdd9d8e8f7e9d1d7632c4657f945ff4f4 (diff) | |
| download | lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.tar.gz lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.tar.bz2 lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.zip | |
'l_mem' renamed to 'l_obj' to count objects
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -531,7 +531,7 @@ static void checkobject (global_State *g, GCObject *o, int maybedead, | |||
| 531 | } | 531 | } |
| 532 | 532 | ||
| 533 | 533 | ||
| 534 | static lu_mem checkgraylist (global_State *g, GCObject *o) { | 534 | static l_obj checkgraylist (global_State *g, GCObject *o) { |
| 535 | int total = 0; /* count number of elements in the list */ | 535 | int total = 0; /* count number of elements in the list */ |
| 536 | cast_void(g); /* better to keep it if we need to print an object */ | 536 | cast_void(g); /* better to keep it if we need to print an object */ |
| 537 | while (o) { | 537 | while (o) { |
| @@ -560,7 +560,7 @@ static lu_mem checkgraylist (global_State *g, GCObject *o) { | |||
| 560 | /* | 560 | /* |
| 561 | ** Check objects in gray lists. | 561 | ** Check objects in gray lists. |
| 562 | */ | 562 | */ |
| 563 | static lu_mem checkgrays (global_State *g) { | 563 | static l_obj checkgrays (global_State *g) { |
| 564 | int total = 0; /* count number of elements in all lists */ | 564 | int total = 0; /* count number of elements in all lists */ |
| 565 | if (!keepinvariant(g)) return total; | 565 | if (!keepinvariant(g)) return total; |
| 566 | total += checkgraylist(g, g->gray); | 566 | total += checkgraylist(g, g->gray); |
| @@ -577,7 +577,7 @@ static lu_mem checkgrays (global_State *g) { | |||
| 577 | ** 'count' and check its TESTBIT. (It must have been previously set by | 577 | ** 'count' and check its TESTBIT. (It must have been previously set by |
| 578 | ** 'checkgraylist'.) | 578 | ** 'checkgraylist'.) |
| 579 | */ | 579 | */ |
| 580 | static void incifingray (global_State *g, GCObject *o, lu_mem *count) { | 580 | static void incifingray (global_State *g, GCObject *o, l_obj *count) { |
| 581 | if (!keepinvariant(g)) | 581 | if (!keepinvariant(g)) |
| 582 | return; /* gray lists not being kept in these phases */ | 582 | return; /* gray lists not being kept in these phases */ |
| 583 | if (o->tt == LUA_VUPVAL) { | 583 | if (o->tt == LUA_VUPVAL) { |
| @@ -594,10 +594,10 @@ static void incifingray (global_State *g, GCObject *o, lu_mem *count) { | |||
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | 596 | ||
| 597 | static lu_mem checklist (global_State *g, int maybedead, int tof, | 597 | static l_obj checklist (global_State *g, int maybedead, int tof, |
| 598 | GCObject *newl, GCObject *survival, GCObject *old, GCObject *reallyold) { | 598 | GCObject *newl, GCObject *survival, GCObject *old, GCObject *reallyold) { |
| 599 | GCObject *o; | 599 | GCObject *o; |
| 600 | lu_mem total = 0; /* number of object that should be in gray lists */ | 600 | l_obj total = 0; /* number of object that should be in gray lists */ |
| 601 | for (o = newl; o != survival; o = o->next) { | 601 | for (o = newl; o != survival; o = o->next) { |
| 602 | checkobject(g, o, maybedead, G_NEW); | 602 | checkobject(g, o, maybedead, G_NEW); |
| 603 | incifingray(g, o, &total); | 603 | incifingray(g, o, &total); |
| @@ -626,8 +626,8 @@ int lua_checkmemory (lua_State *L) { | |||
| 626 | global_State *g = G(L); | 626 | global_State *g = G(L); |
| 627 | GCObject *o; | 627 | GCObject *o; |
| 628 | int maybedead; | 628 | int maybedead; |
| 629 | lu_mem totalin; /* total of objects that are in gray lists */ | 629 | l_obj totalin; /* total of objects that are in gray lists */ |
| 630 | lu_mem totalshould; /* total of objects that should be in gray lists */ | 630 | l_obj totalshould; /* total of objects that should be in gray lists */ |
| 631 | if (keepinvariant(g)) { | 631 | if (keepinvariant(g)) { |
| 632 | assert(!iswhite(g->mainthread)); | 632 | assert(!iswhite(g->mainthread)); |
| 633 | assert(!iswhite(gcvalue(&g->l_registry))); | 633 | assert(!iswhite(gcvalue(&g->l_registry))); |
| @@ -1033,7 +1033,7 @@ static int query_inc (lua_State *L) { | |||
| 1033 | lua_pushinteger(L, g->GCdebt); | 1033 | lua_pushinteger(L, g->GCdebt); |
| 1034 | lua_pushinteger(L, getgcparam(g->gcpause)); | 1034 | lua_pushinteger(L, getgcparam(g->gcpause)); |
| 1035 | lua_pushinteger(L, getgcparam(g->gcstepmul)); | 1035 | lua_pushinteger(L, getgcparam(g->gcstepmul)); |
| 1036 | lua_pushinteger(L, cast(l_mem, 1) << g->gcstepsize); | 1036 | lua_pushinteger(L, cast(l_obj, 1) << g->gcstepsize); |
| 1037 | return 5; | 1037 | return 5; |
| 1038 | } | 1038 | } |
| 1039 | 1039 | ||
