MCPcopy Create free account
hub / github.com/dds-bridge/dds / TransTableL

Method TransTableL

library/src/trans_table/trans_table_l.cpp:191–219  ·  view source on GitHub ↗

* @brief Large transposition table for double dummy solver. * * TransTableL implements a large, memory-intensive transposition table * used to cache and retrieve results during double dummy bridge analysis. * It manages memory allocation, lookup, and statistics for position caching. */

Source from the content-addressed store, hash-verified

189 * It manages memory allocation, lookup, and statistics for position caching.
190*/
191TransTableL::TransTableL()
192{
193 // Touch the tables once to ensure construction.
194 (void)tt_lowest_rank_table();
195 (void)mask_bytes_table();
196 (void)players();
197 // Initialize all internal state to safe defaults. Some of these
198 // fields were previously left uninitialized and relied on implicit
199 // zeroing via legacy construction paths. With newer creation flows
200 // (via SolverContext), make the invariants explicit here.
201 tt_in_use_ = 0;
202 mem_state_ = MemState::FROM_POOL;
203 pages_default_ = 0;
204 pages_current_ = 0;
205 pages_maximum_ = 0;
206 harvest_trick_ = 0;
207 harvest_hand_ = 0;
208 page_stats_ = PageStats{0,0,0,0,0};
209 timestamp_ = 0;
210 pool_ = nullptr;
211 next_block_ = nullptr;
212 harvested_.next_block_no_ = 0;
213 for (int c = 0; c < TtTricks; ++c) {
214 for (int h = 0; h < DDS_HANDS; ++h) {
215 tt_root_[c][h] = nullptr;
216 last_block_seen_[c][h] = nullptr;
217 }
218 }
219}
220
221/**
222 * @brief Destroy the TransTableL object and free all memory.

Callers

nothing calls this directly

Calls 3

tt_lowest_rank_tableFunction · 0.85
mask_bytes_tableFunction · 0.85
playersFunction · 0.85

Tested by

no test coverage detected