Exemplo n.º 1
0
//NOTE: lua_newstate becomes NewStateAlloc whereas
//		luaL_newstate becomes NewState
func NewStateAlloc(f Alloc) *State {
	//TODO: implement a newState function which will initialize a State
	//		call with result from C.lua_newstate for the s initializer
	//ls := lua_newstate(
	ls := C.clua_newstate(unsafe.Pointer(&f))
	//ls := clua_newstate(
	return newState(ls)
}
Exemplo n.º 2
0
Arquivo: lua.go Projeto: szll/golua
// Creates a new lua interpreter state with the given allocation function
func NewStateAlloc(f Alloc) *State {
	ls := C.clua_newstate(unsafe.Pointer(&f))
	return newState(ls)
}