Add low-overhead profiler. Part 1: interpreter, low-level C API.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "lj_vm.h"
|
||||
#include "lj_lex.h"
|
||||
#include "lj_alloc.h"
|
||||
#include "luajit.h"
|
||||
|
||||
/* -- Stack handling ------------------------------------------------------ */
|
||||
|
||||
@@ -237,8 +238,11 @@ LUA_API void lua_close(lua_State *L)
|
||||
{
|
||||
global_State *g = G(L);
|
||||
int i;
|
||||
setgcrefnull(g->cur_L);
|
||||
L = mainthread(g); /* Only the main thread can be closed. */
|
||||
#if LJ_HASPROFILE
|
||||
luaJIT_profile_stop(L);
|
||||
#endif
|
||||
setgcrefnull(g->cur_L);
|
||||
lj_func_closeuv(L, tvref(L->stack));
|
||||
lj_gc_separateudata(g, 1); /* Separate udata which have GC metamethods. */
|
||||
#if LJ_HASJIT
|
||||
|
||||
Reference in New Issue
Block a user