Download unify/third_party/lua/src/lgc.h from Snapkitty/repoverse: direct link, hf CLI and curl.
- Browser
- Download file 6.43 kB
-
https://huggingface.co/Snapkitty/repoverse/resolve/main/unify/third_party/lua/src/lgc.h
- Command line
-
hf download hf://Snapkitty/repoverse/unify/third_party/lua/src/lgc.h
-
curl -L -o lgc.h https://huggingface.co/Snapkitty/repoverse/resolve/main/unify/third_party/lua/src/lgc.h
6.43 kB
| /* | |
| ** $Id: lgc.h $ | |
| ** Garbage Collector | |
| ** See Copyright Notice in lua.h | |
| */ | |
| /* | |
| ** Collectable objects may have one of three colors: white, which means | |
| ** the object is not marked; gray, which means the object is marked, but | |
| ** its references may be not marked; and black, which means that the | |
| ** object and all its references are marked. The main invariant of the | |
| ** garbage collector, while marking objects, is that a black object can | |
| ** never point to a white one. Moreover, any gray object must be in a | |
| ** "gray list" (gray, grayagain, weak, allweak, ephemeron) so that it | |
| ** can be visited again before finishing the collection cycle. (Open | |
| ** upvalues are an exception to this rule.) These lists have no meaning | |
| ** when the invariant is not being enforced (e.g., sweep phase). | |
| */ | |
| /* | |
| ** Possible states of the Garbage Collector | |
| */ | |
| /* | |
| ** macro to tell when main invariant (white objects cannot point to black | |
| ** ones) must be kept. During a collection, the sweep | |
| ** phase may break the invariant, as objects turned white may point to | |
| ** still-black objects. The invariant is restored when sweep ends and | |
| ** all objects are white again. | |
| */ | |
| /* | |
| ** some useful bit tricks | |
| */ | |
| /* | |
| ** Layout for bit use in 'marked' field. First three bits are | |
| ** used for object "age" in generational mode. Last bit is used | |
| ** by tests. | |
| */ | |
| /* object age in generational mode */ | |
| /* Default Values for GC parameters */ | |
| /* wait memory to double before starting new cycle */ | |
| /* | |
| ** some gc parameters are stored divided by 4 to allow a maximum value | |
| ** up to 1023 in a 'lu_byte'. | |
| */ | |
| /* how much to allocate before next GC step (log2) */ | |
| /* | |
| ** Check whether the declared GC mode is generational. While in | |
| ** generational mode, the collector can go temporarily to incremental | |
| ** mode to improve performance. This is signaled by 'g->lastatomic != 0'. | |
| */ | |
| /* | |
| ** Control when GC is running: | |
| */ | |
| /* | |
| ** Does one step of collection when debt becomes positive. 'pre'/'pos' | |
| ** allows some adjustments to be done only when needed. macro | |
| ** 'condchangemem' is used only for heavy tests (forcing a full | |
| ** GC cycle on every opportunity) | |
| */ | |
| /* more often than not, 'pre'/'pos' are empty */ | |
| LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); | |
| LUAI_FUNC void luaC_freeallobjects (lua_State *L); | |
| LUAI_FUNC void luaC_step (lua_State *L); | |
| LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); | |
| LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); | |
| LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); | |
| LUAI_FUNC GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, | |
| size_t offset); | |
| LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); | |
| LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); | |
| LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); | |
| LUAI_FUNC void luaC_changemode (lua_State *L, int newmode); | |