mirror of
https://github.com/CompeyDev/lei.git
synced 2024-12-12 12:50:42 +00:00
feat: complete lua.h bindings ref system
This commit is contained in:
parent
f8b1807e91
commit
ba0fb22db0
1 changed files with 19 additions and 0 deletions
|
@ -660,5 +660,24 @@ func GetAllocF(L *LuaState, ud *unsafe.Pointer) LuaAlloc {
|
|||
return *(*LuaAlloc)(unsafe.Pointer(C.lua_getallocf(L, ud)))
|
||||
}
|
||||
|
||||
//
|
||||
// ==========================
|
||||
// Reference System
|
||||
// ==========================
|
||||
//
|
||||
|
||||
const (
|
||||
LUA_NOREF = iota - 1
|
||||
LUA_REFNIL
|
||||
)
|
||||
|
||||
func Ref(L *LuaState, idx int32) int32 {
|
||||
return int32(C.lua_ref(L, C.int(idx)))
|
||||
}
|
||||
|
||||
func Unref(L *LuaState, ref int32) {
|
||||
C.lua_unref(L, C.int(ref))
|
||||
}
|
||||
|
||||
// TODO: Free udtor's after func
|
||||
// TODO: Rest of it
|
||||
|
|
Loading…
Reference in a new issue