** Decide whether to shift to major mode. It shifts if the accumulated ** number of added old bytes (counted in 'GCmarked') is larger than ** 'minormajor'% of the number of lived bytes after the last major ** collection. (This number is kept in 'GCmajorminor'.) */
| 1321 | ** collection. (This number is kept in 'GCmajorminor'.) |
| 1322 | */ |
| 1323 | static int checkminormajor (global_State *g) { |
| 1324 | l_mem limit = applygcparam(g, MINORMAJOR, g->GCmajorminor); |
| 1325 | if (limit == 0) |
| 1326 | return 0; /* special case: 'minormajor' 0 stops major collections */ |
| 1327 | return (g->GCmarked >= limit); |
| 1328 | } |
| 1329 | |
| 1330 | /* |
| 1331 | ** Does a young collection. First, mark 'OLD1' objects. Then does the |