Skip to content

Commit

Permalink
wrap call to lua_gc() with lua_unlock()/lua_lock() to avoid assertion…
Browse files Browse the repository at this point in the history
… failure
  • Loading branch information
Dibyendu Majumdar committed Sep 6, 2015
1 parent 4fc119e commit 2da4a33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ravi_llvmcodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,11 @@ void RaviCodeGenerator::compile(lua_State *L, Proto *p,
// RaviFunctionDef *def = &definition;

int gcstep = this->jitState_->get_gcstep();
if (gcstep > 0 && (id_ % gcstep) == 0)
if (gcstep > 0 && (id_ % gcstep) == 0) {
lua_unlock(L);
lua_gc(L, LUA_GCCOLLECT, 0);
lua_lock(L);
}

// printf("compiling function\n");
auto f = create_function(builder, def);
Expand Down

0 comments on commit 2da4a33

Please sign in to comment.