| 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 | { |
no test coverage detected