MCPcopy Create free account
hub / github.com/NetHack/NetHack / nhl_done

Function nhl_done

src/nhlua.c:2365–2389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2363}
2364
2365RESTORE_WARNING_CONDEXPR_IS_CONSTANT
2366
2367void
2368nhl_done(lua_State *L)
2369{
2370 if (L) {
2371 nhl_user_data *nud = 0;
2372 (void) lua_getallocf(L, (void **) &nud);
2373 if (gl.loglua) {
2374 if (nud && nud->osteps) {
2375 long ic = nud->statctr * NHL_SB_STEPSIZE; // an approximation
2376 livelog_printf(LL_DEBUG, "LUASTATS DONE %d:%s %ld", nud->sid,
2377 nud->name, ic);
2378 }
2379 if (nud && nud->memlimit && !nud->perpcall) {
2380 livelog_printf(LL_DEBUG, "LUASTATS DMEM %d:%s %lu", nud->sid,
2381 nud->name, (long unsigned) nhl_getmeminuse(L));
2382 }
2383 }
2384 lua_close(L);
2385 if (nud)
2386 nhl_alloc(NULL, nud, 0, 0); // free nud
2387 }
2388 iflags.in_lua = FALSE;
2389}
2390
2391boolean
2392load_lua(const char *name, nhl_sandbox_info *sbi)

Callers 9

com_pager_coreFunction · 0.85
l_nhcore_doneFunction · 0.85
l_nhcore_callFunction · 0.85
nhl_initFunction · 0.85
load_luaFunction · 0.85
get_lua_versionFunction · 0.85
init_dungeonsFunction · 0.85
free_luathemesFunction · 0.85
makeroomsFunction · 0.85

Calls 3

livelog_printfFunction · 0.85
nhl_getmeminuseFunction · 0.85
nhl_allocFunction · 0.85

Tested by

no test coverage detected