Liveness of slot i. Packed tables are dense in [0,size) (insertion order, swap-remove on erase), so a slot is live iff i<size — no hash read. Large tables are open-addressed: a string table is live iff the 32-bit hash is past the KILLED sentinel; a non-string table iff the 1-byte control is past TOMBSTONE. EVERY liveness scan (GC, RTTI/data walk, iterators) must route through this: representation
| 75 | // this: representation varies by capacity AND key type (a packed string table stores 64-bit |
| 76 | // hashes), so a raw 32-bit `hashes[i] > KILLED` read would misindex it. |
| 77 | __forceinline bool tableLiveSlot ( const Table & tab, uint64_t i ) { |
| 78 | // Only STRING tables pack (dense [0,size)); non-string keys are open-addressed at every capacity. |
| 79 | if ( !tab.tableNoHash && tab.capacity <= TABLE_MAX_LINEAR_CAPACITY ) return i < tab.size; |
| 80 | if ( tab.tableNoHash ) return ((const uint8_t *) tab.hashes)[i] > CTRL_TOMBSTONE; |
| 81 | return tab.hashes[i] > HASH_KILLED64; |
| 82 | } |
| 83 | |
| 84 | // Bytes per hash slot for the type-erased table-size computations (free / GC range) that have |
| 85 | // no C++ KeyType. The width is NOT a pure function of capacity: a non-string key stores no |
no outgoing calls
no test coverage detected