MCPcopy Create free account
hub / github.com/Tencent/UnLua / GetPointer

Function GetPointer

Plugins/UnLua/Source/UnLua/Private/UnLuaBase.cpp:283–296  ·  view source on GitHub ↗

* Get the address of user data at the given stack index */

Source from the content-addressed store, hash-verified

281 * Get the address of user data at the given stack index
282 */
283 void* GetPointer(lua_State *L, int32 Index, bool *OutTwoLvlPtr)
284 {
285 bool bTwoLvlPtr = false;
286 void *Userdata = ::GetUserdataFast(L, Index, &bTwoLvlPtr);
287 if (Userdata)
288 {
289 if (OutTwoLvlPtr)
290 {
291 *OutTwoLvlPtr = bTwoLvlPtr;
292 }
293 return bTwoLvlPtr ? *((void**)Userdata) : Userdata; // return the address
294 }
295 return nullptr;
296 }
297
298 /**
299 * Push a UObject

Callers 4

BuildFromUserdataMethod · 0.85
GetMethod · 0.85
GetMethod · 0.85
DefineMethod · 0.85

Calls 1

GetUserdataFastFunction · 0.85

Tested by 1

DefineMethod · 0.68