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

Function NewSmartPointer

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

* Allocate user data for smart pointer */

Source from the content-addressed store, hash-verified

319 * Allocate user data for smart pointer
320 */
321 void* NewSmartPointer(lua_State *L, int32 Size, const char *MetatableName)
322 {
323 void *Userdata = ::NewUserdataWithPadding(L, Size, MetatableName);
324 if (Userdata)
325 {
326 MarkUserdataTwoLvPtrTag(Userdata); // mark the new userdata as a two level pointer
327 }
328 return Userdata;
329 }
330
331 /**
332 * Get the address of smart pointer at the given stack index

Callers 2

PushFunction · 0.85
RegisterMethod · 0.85

Calls 2

NewUserdataWithPaddingFunction · 0.85
MarkUserdataTwoLvPtrTagFunction · 0.85

Tested by

no test coverage detected