went back to vector for TT #14

Merged
rektdie merged 2 commits from vectorTT into legalMovegen 2025-03-11 13:44:47 +01:00
2 changed files with 11 additions and 2 deletions

No files matched your search

+10 -2
View File
@@ -1,6 +1,7 @@
#pragma once
#include "board.h"
#include "search.h"
#include <vector>
// 2[colors] * 6[pieces] * 64[squares]
extern U64 zKeys[2][6][64];
@@ -40,10 +41,17 @@ constexpr int invalidEntry = 111111;
class TTable {
private:
std::array<TTEntry, maxHash> table;
std::vector<TTEntry> table;
public:
TTable() : table(hashSize) {};
void Resize(U64 size) {
table.resize(size);
}
void Clear() {
table.fill(TTEntry{});
table.clear();
table.resize(hashSize);
}
TTEntry* GetRawEntry(U64 &hashKey) {
+1
View File
@@ -165,6 +165,7 @@ void ParseGo(Board &board, std::string &command) {
static void SetOption(std::string &command) {
if (command.find("Hash") != std::string::npos) {
hashSize = (ReadParam("value", command) * 1000000) / sizeof(TTEntry);
TT.Resize(hashSize);
}
}