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
## without releasing the memory
## 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) =

View File

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