Beispiel #1
0
func makeValueProxy(L *lua.State, val reflect.Value, proxyMT string) {
	rawptr := L.NewUserdata(uintptr(unsafe.Sizeof(ValueProxy{})))
	ptr := (*ValueProxy)(rawptr)
	ptr.value = val
	ptr.t = val.Type()
	lua.LGetMetaTable(L, proxyMT)
	L.SetMetaTable(-2)
}