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

Function getmode

third-party/lua-5.5.0/src/lgc.c:595–605  ·  view source on GitHub ↗

** (result & 1) iff weak values; (result & 2) iff weak keys. */

Source from the content-addressed store, hash-verified

593** (result & 1) iff weak values; (result & 2) iff weak keys.
594*/
595static int getmode (global_State *g, Table *h) {
596 const TValue *mode = gfasttm(g, h->metatable, TM_MODE);
597 if (mode == NULL || !ttisstring(mode))
598 return 0; /* ignore non-string modes */
599 else {
600 const char *smode = getstr(tsvalue(mode));
601 const char *weakkey = strchr(smode, 'k');
602 const char *weakvalue = strchr(smode, 'v');
603 return ((weakkey != NULL) << 1) | (weakvalue != NULL);
604 }
605}
606
607
608static l_mem traversetable (global_State *g, Table *h) {

Callers 1

traversetableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected