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

Function get_weak_table

Source/Misc/luabind/src/weak_ref.cpp:41–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41 void get_weak_table(lua_State* L)
42 {
43 lua_rawgetp(L, LUA_REGISTRYINDEX, &weak_table_tag);
44
45 if (lua_isnil(L, -1))
46 {
47 lua_pop(L, 1);
48 lua_newtable(L);
49 // metatable
50 lua_createtable(L, 0, 1); // One non-sequence entry for __mode.
51 lua_pushliteral(L, "__mode");
52 lua_pushliteral(L, "v");
53 lua_rawset(L, -3);
54 // set metatable
55 lua_setmetatable(L, -2);
56
57 lua_pushvalue(L, -1);
58 lua_rawsetp(L, LUA_REGISTRYINDEX, &weak_table_tag);
59
60 }
61
62 }
63
64 void get_impl_table(lua_State* L)
65 {

Callers 2

implMethod · 0.85
getMethod · 0.85

Calls 6

lua_rawgetpFunction · 0.85
lua_createtableFunction · 0.85
lua_rawsetFunction · 0.85
lua_setmetatableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_rawsetpFunction · 0.85

Tested by

no test coverage detected