MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaH_newkey

Function luaH_newkey

third-party/lua-5.5.0/src/ltable.c:914–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912
913
914static void luaH_newkey (lua_State *L, Table *t, const TValue *key,
915 TValue *value) {
916 if (!ttisnil(value)) { /* do not insert nil values */
917 int done = insertkey(t, key, value);
918 if (!done) { /* could not find a free place? */
919 rehash(L, t, key); /* grow table */
920 newcheckedkey(t, key, value); /* insert key in grown table */
921 }
922 luaC_barrierback(L, obj2gco(t), key);
923 /* for debugging only: any new key may force an emergency collection */
924 condchangemem(L, (void)0, (void)0, 1);
925 }
926}
927
928
929static const TValue *getintfromhash (Table *t, lua_Integer key) {

Callers 2

luaH_finishsetFunction · 0.70
luaH_setintFunction · 0.70

Calls 4

insertkeyFunction · 0.85
newcheckedkeyFunction · 0.85
luaC_barrierbackFunction · 0.85
rehashFunction · 0.70

Tested by

no test coverage detected