MCPcopy Create free account
hub / github.com/defold/defold / PushHashWeakTableKey

Function PushHashWeakTableKey

engine/script/src/script_hash.cpp:48–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 static uint32_t SCRIPT_HASH_TYPE_HASH = 0;
47
48 static inline void PushHashWeakTableKey(lua_State* L, dmhash_t hash)
49 {
50 // The weak table is indexed by full 64-bit hashes. Lua numbers are doubles
51 // and lua_rawgeti() takes an int, so numeric keys can lose
52 // bits and let stale hash userdata erase a live cache entry.
53 lua_pushlstring(L, (const char*)&hash, sizeof(hash));
54 }
55
56 bool IsHash(lua_State *L, int index)
57 {

Callers 3

CreateLuaHashUserdataFunction · 0.85
PushHashFunction · 0.85
Hash_gcFunction · 0.85

Calls 1

lua_pushlstringFunction · 0.85

Tested by

no test coverage detected