diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-10-23 17:15:06 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-10-23 17:15:06 -0300 |
| commit | 5ffcd458f001fce02e5f20a6130e145c6a3caf53 (patch) | |
| tree | 4e4ae6f2c0be73beb037c6f6e1c4931dc76418c5 | |
| parent | 9b01da97e3a8f2df9acbd3b86af50e4040e9d914 (diff) | |
| download | lua-5ffcd458f001fce02e5f20a6130e145c6a3caf53.tar.gz lua-5ffcd458f001fce02e5f20a6130e145c6a3caf53.tar.bz2 lua-5ffcd458f001fce02e5f20a6130e145c6a3caf53.zip | |
Some changes in default GC parameters
| -rw-r--r-- | lgc.c | 4 | ||||
| -rw-r--r-- | lgc.h | 10 |
2 files changed, 6 insertions, 8 deletions
| @@ -1675,7 +1675,7 @@ void luaC_runtilstate (lua_State *L, int state, int fast) { | |||
| 1675 | */ | 1675 | */ |
| 1676 | static void incstep (lua_State *L, global_State *g) { | 1676 | static void incstep (lua_State *L, global_State *g) { |
| 1677 | l_mem stepsize = applygcparam(g, STEPSIZE, 100); | 1677 | l_mem stepsize = applygcparam(g, STEPSIZE, 100); |
| 1678 | l_mem work2do = applygcparam(g, STEPMUL, stepsize); | 1678 | l_mem work2do = applygcparam(g, STEPMUL, stepsize / cast_int(sizeof(void*))); |
| 1679 | l_mem stres; | 1679 | l_mem stres; |
| 1680 | int fast = (work2do == 0); /* special case: do a full collection */ | 1680 | int fast = (work2do == 0); /* special case: do a full collection */ |
| 1681 | do { /* repeat until enough work */ | 1681 | do { /* repeat until enough work */ |
| @@ -1739,8 +1739,6 @@ static void fullinc (lua_State *L, global_State *g) { | |||
| 1739 | /* finish any pending sweep phase to start a new cycle */ | 1739 | /* finish any pending sweep phase to start a new cycle */ |
| 1740 | luaC_runtilstate(L, GCSpause, 1); | 1740 | luaC_runtilstate(L, GCSpause, 1); |
| 1741 | luaC_runtilstate(L, GCScallfin, 1); /* run up to finalizers */ | 1741 | luaC_runtilstate(L, GCScallfin, 1); /* run up to finalizers */ |
| 1742 | /* 'marked' must be correct after a full GC cycle */ | ||
| 1743 | /* lua_assert(g->GCmarked == gettotalobjs(g)); ??? */ | ||
| 1744 | luaC_runtilstate(L, GCSpause, 1); /* finish collection */ | 1742 | luaC_runtilstate(L, GCSpause, 1); /* finish collection */ |
| 1745 | setpause(g); | 1743 | setpause(g); |
| 1746 | } | 1744 | } |
| @@ -170,7 +170,7 @@ | |||
| 170 | ** Minor collections will shift to major ones after LUAI_MINORMAJOR% | 170 | ** Minor collections will shift to major ones after LUAI_MINORMAJOR% |
| 171 | ** bytes become old. | 171 | ** bytes become old. |
| 172 | */ | 172 | */ |
| 173 | #define LUAI_MINORMAJOR 100 | 173 | #define LUAI_MINORMAJOR 70 |
| 174 | 174 | ||
| 175 | /* | 175 | /* |
| 176 | ** Major collections will shift to minor ones after a collection | 176 | ** Major collections will shift to minor ones after a collection |
| @@ -182,20 +182,20 @@ | |||
| 182 | ** A young (minor) collection will run after creating LUAI_GENMINORMUL% | 182 | ** A young (minor) collection will run after creating LUAI_GENMINORMUL% |
| 183 | ** new bytes. | 183 | ** new bytes. |
| 184 | */ | 184 | */ |
| 185 | #define LUAI_GENMINORMUL 25 | 185 | #define LUAI_GENMINORMUL 20 |
| 186 | 186 | ||
| 187 | 187 | ||
| 188 | /* incremental */ | 188 | /* incremental */ |
| 189 | 189 | ||
| 190 | /* Number of bytes must be LUAI_GCPAUSE% before starting new cycle */ | 190 | /* Number of bytes must be LUAI_GCPAUSE% before starting new cycle */ |
| 191 | #define LUAI_GCPAUSE 200 | 191 | #define LUAI_GCPAUSE 250 |
| 192 | 192 | ||
| 193 | /* | 193 | /* |
| 194 | ** Step multiplier: The collector handles LUAI_GCMUL% work units for | 194 | ** Step multiplier: The collector handles LUAI_GCMUL% work units for |
| 195 | ** each new allocated byte. (Each "work unit" corresponds roughly to | 195 | ** each new allocated word. (Each "work unit" corresponds roughly to |
| 196 | ** sweeping one object or traversing one slot.) | 196 | ** sweeping one object or traversing one slot.) |
| 197 | */ | 197 | */ |
| 198 | #define LUAI_GCMUL 40 | 198 | #define LUAI_GCMUL 200 |
| 199 | 199 | ||
| 200 | /* How many bytes to allocate before next GC step */ | 200 | /* How many bytes to allocate before next GC step */ |
| 201 | #define LUAI_GCSTEPSIZE (200 * sizeof(Table)) | 201 | #define LUAI_GCSTEPSIZE (200 * sizeof(Table)) |
