MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / push_new_instance

Function push_new_instance

Source/Misc/luabind/src/object_rep.cpp:321–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319 }
320
321 LUABIND_API object_rep* push_new_instance(lua_State* L, class_rep* cls)
322 {
323 void* storage = lua_newuserdata(L, sizeof(object_rep));
324 object_rep* result = new (storage) object_rep(0, cls);
325 cls->get_table(L);
326 lua_setuservalue(L, -2);
327 lua_rawgeti(L, LUA_REGISTRYINDEX, cls->metatable_ref());
328 lua_setmetatable(L, -2);
329 return result;
330 }
331
332}}

Callers 2

make_instanceFunction · 0.85

Calls 3

lua_newuserdataFunction · 0.85
lua_rawgetiFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected