MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_sethook

Function lua_sethook

lib/lua/src/ldebug.c:131–142  ·  view source on GitHub ↗

** This function can be called during a signal, under "reasonable" ** assumptions. ** Fields 'basehookcount' and 'hookcount' (set by 'resethookcount') ** are for debug only, and it is no problem if they get arbitrary ** values (causes at most one wrong hook call). 'hookmask' is an atomic ** value. We assume that pointers are atomic too (e.g., gcc ensures that ** for all platforms where it runs). M

Source from the content-addressed store, hash-verified

129** before being called (see 'luaD_hook').
130*/
131LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
132 if (func == NULL || mask == 0) { /* turn off hooks? */
133 mask = 0;
134 func = NULL;
135 }
136 L->hook = func;
137 L->basehookcount = count;
138 resethookcount(L);
139 L->hookmask = cast_byte(mask);
140 if (mask)
141 settraps(L->ci); /* to trace inside 'luaV_execute' */
142}
143
144
145LUA_API lua_Hook lua_gethook (lua_State *L) {

Callers 5

lstopFunction · 0.85
lactionFunction · 0.85
db_sethookFunction · 0.85
compileTransformsLuaMethod · 0.85
createStateMethod · 0.85

Calls 1

settrapsFunction · 0.85

Tested by

no test coverage detected