Added code to probe 'interface'
This commit is contained in:
@@ -8,6 +8,11 @@ LuaNilMarker LuaNil;
|
||||
LuaNewTableMarker LuaNewTable;
|
||||
LuaDiscardMarker LuaDiscard;
|
||||
|
||||
void LuaStack::clear_tagged_pointer(LuaSlot target) {
|
||||
TaggedPointer *tp = (TaggedPointer*)lua_touserdata(L_, target.index());
|
||||
tp->ptr = 0;
|
||||
}
|
||||
|
||||
void LuaStack::make_tagged_pointer(LuaSlot target, void *ptr, LuaTypeTag tag, LuaDeleterFn del) {
|
||||
TaggedPointer *tp = (TaggedPointer*)lua_newuserdata(L_, sizeof(TaggedPointer));
|
||||
tp->ptr = ptr;
|
||||
@@ -21,7 +26,7 @@ void LuaStack::make_tagged_pointer(LuaSlot target, void *ptr, LuaTypeTag tag, Lu
|
||||
}
|
||||
|
||||
int LuaStack::collect_tagged_pointer(lua_State *L) {
|
||||
LuaStack::TaggedPointer *p = (LuaStack::TaggedPointer*)lua_touserdata(L, 1);
|
||||
TaggedPointer *p = (TaggedPointer*)lua_touserdata(L, 1);
|
||||
if (p==0) {
|
||||
luaL_error(L, "lua deleter function received a non-userdata");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user