| 2363 | } |
| 2364 | |
| 2365 | RESTORE_WARNING_CONDEXPR_IS_CONSTANT |
| 2366 | |
| 2367 | void |
| 2368 | nhl_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 | |
| 2391 | boolean |
| 2392 | load_lua(const char *name, nhl_sandbox_info *sbi) |
no test coverage detected