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

Function push_function_metatable

Source/Misc/luabind/src/function.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 void push_function_metatable(lua_State* L)
27 {
28 lua_rawgetp(L, LUA_REGISTRYINDEX, &function_tag);
29
30 if (lua_istable(L, -1))
31 return;
32
33 lua_pop(L, 1);
34
35 lua_createtable(L, 0, 1); // One non-sequence entry for __gc.
36
37 lua_pushliteral(L, "__gc");
38 lua_pushcfunction(L, &function_destroy);
39 lua_rawset(L, -3);
40
41 lua_pushvalue(L, -1);
42 lua_rawsetp(L, LUA_REGISTRYINDEX, &function_tag);
43 }
44
45} // namespace unnamed
46

Callers 1

make_function_auxFunction · 0.85

Calls 5

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

Tested by

no test coverage detected