Esempio n. 1
0
LUALIB_API lua_State *luaL_newstate(void)
{
  lua_State *L;
  void *ud = lj_alloc_create();
  if (ud == NULL) return NULL;
#if LJ_64
  L = lj_state_newstate(lj_alloc_f, ud);
#else
  L = lua_newstate(lj_alloc_f, ud);
#endif
  if (L) G(L)->panic = panic;
  return L;
}
Esempio n. 2
0
LUALIB_API lua_State *luaL_newstate_mmap(lua_Mmap cust_mmap, lua_Munmap cust_munmap)
{
  lua_State *L;
  void *ud = lj_alloc_create(cust_mmap, cust_munmap);
  if (ud == NULL) return NULL;
#if LJ_64
  L = lj_state_newstate(lj_alloc_f, ud);
#else
  L = lua_newstate(lj_alloc_f, ud);
#endif
  if (L) G(L)->panic = panic;
  return L;
}
Esempio n. 3
0
LUALIB_API lua_State *luaL_newstate(void)
{
  fputs("luaL_newstate", stderr);
  fflush(stderr);
  lua_State *L;
  void *ud = lj_alloc_create();
  if (ud == NULL) return NULL;
#if LJ_64
  L = lj_state_newstate(lj_alloc_f, ud);
  printf("%s\n", "lj_state_newstate");
#else
  L = lua_newstate(lj_alloc_f, ud);
  printf("%s\n", "lua_newstate");
#endif
  if (L) G(L)->panic = panic;
  return L;
}