Fix clear() proc for transposition table

This commit is contained in:
Mattia Giambirtone 2024-05-14 17:03:28 +02:00
parent 30b3de233f
commit d4dfa6b325
2 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,8 @@ func clear*(self: var TTable) {.inline.} =
## Clears the transposition table ## Clears the transposition table
## without releasing the memory ## without releasing the memory
## associated with it ## associated with it
self.data.setLen(0) for i in 0..self.data.high():
self.data[i] = TTEntry()
func resize*(self: var TTable, newSize: uint64) = func resize*(self: var TTable, newSize: uint64) =

View File

@ -466,6 +466,8 @@ proc startUCISession* =
if session.debug: if session.debug:
echo &"info string set TT hash table size to {session.hashTableSize} MiB" echo &"info string set TT hash table size to {session.hashTableSize} MiB"
of "TTClear": of "TTClear":
if session.debug:
echo "info string clearing TT"
transpositionTable[].clear() transpositionTable[].clear()
of "Threads": of "Threads":
let numWorkers = cmd.value.parseInt() let numWorkers = cmd.value.parseInt()