Exemple #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)
}
Exemple #2
0
// 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)
}