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

Function GetCppInstance

Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:455–464  ·  view source on GitHub ↗

* Get a cpp instance's address */

Source from the content-addressed store, hash-verified

453 * Get a cpp instance's address
454 */
455void* GetCppInstance(lua_State *L, int32 Index)
456{
457 bool bTwoLvlPtr = false;
458 void *Userdata = GetUserdata(L, Index, &bTwoLvlPtr);
459 if (Userdata)
460 {
461 return bTwoLvlPtr ? *((void**)Userdata) : Userdata; // return instance's address
462 }
463 return nullptr;
464}
465
466/**
467 * Get a cpp instance's address, fast path

Callers 5

GetUPropertyFunction · 0.85
SetUPropertyFunction · 0.85
GetUObjectFunction · 0.85
Class_IndexFunction · 0.85
Class_NewIndexFunction · 0.85

Calls 1

GetUserdataFunction · 0.85

Tested by

no test coverage detected