** Performs a full GC cycle; if 'isemergency', set a flag to avoid ** some operations which could change the interpreter state in some ** unexpected ways (running finalizers and shrinking some structures). */
| 1784 | ** unexpected ways (running finalizers and shrinking some structures). |
| 1785 | */ |
| 1786 | void luaC_fullgc (lua_State *L, int isemergency) { |
| 1787 | global_State *g = G(L); |
| 1788 | lua_assert(!g->gcemergency); |
| 1789 | g->gcemergency = cast_byte(isemergency); /* set flag */ |
| 1790 | switch (g->gckind) { |
| 1791 | case KGC_GENMINOR: fullgen(L, g); break; |
| 1792 | case KGC_INC: fullinc(L, g); break; |
| 1793 | case KGC_GENMAJOR: |
| 1794 | g->gckind = KGC_INC; |
| 1795 | fullinc(L, g); |
| 1796 | g->gckind = KGC_GENMAJOR; |
| 1797 | break; |
| 1798 | } |
| 1799 | g->gcemergency = 0; |
| 1800 | } |
| 1801 | |
| 1802 | /* }====================================================== */ |
| 1803 |
no test coverage detected