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

Method init_tt

library/src/trans_table/trans_table_s.cpp:305–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303
304
305auto TransTableS::init_tt() -> void
306{
307 win_set_size_limit_ = WINIT;
308 node_set_size_limit_ = NINIT;
309 allocmem_ = (WINIT + 1) * sizeof(WinCard);
310 allocmem_ += 1ULL * (NINIT + 1) * sizeof(NodeCards);
311 allocmem_ += 1ULL * (LSIZE + 1) * 52 * sizeof(PosSearchSmall);
312 win_cards_ = pw_[0];
313 node_cards_ = pn_[0];
314 wcount_ = 0;
315 ncount_ = 0;
316
317 node_set_size_ = 0;
318 win_set_size_ = 0;
319
320 clear_tt_flag_ = false;
321 windex_ = -1;
322
323 for (int k = 1; k <= 13; k++)
324 for (int h = 0; h < DDS_HANDS; h++)
325 {
326 pos_search_[k][h] = pl_[k][h][0];
327 // Set len_set_ind_ to 1 (not 0) because index 0 is reserved for the root node.
328 // This ensures that the first Lookup/Add can safely use index 1,
329 // and avoids overwriting the valid empty node at index 0.
330 len_set_ind_[k][h] = 1;
331 lcount_[k][h] = 0;
332 // Initialize the root node to a valid empty node so that a
333 // first Lookup/Add can function even before ResetMemory.
334 pos_search_[k][h][0].suit_lengths_ = 0;
335 pos_search_[k][h][0].pos_search_point_ = nullptr;
336 pos_search_[k][h][0].left_ = nullptr;
337 pos_search_[k][h][0].right_ = nullptr;
338 rootnp_[k][h] = &(pos_search_[k][h][0]);
339 }
340}
341
342
343auto TransTableS::reset_memory(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected