change repetitionTable memory allocation place

This commit is contained in:
2024-09-24 22:08:21 +02:00
parent 2c3d1bc021
commit 6e61a14cdb
8 changed files with 26 additions and 16 deletions

View File

@ -23,8 +23,10 @@ uint_least8_t getRank(const uint_least8_t field) {
return field / BOARD_SIZE;
}
struct zobristTable initZobirstTable(size_t length) {
struct zobristTableElement *table = calloc(length, sizeof *table);
struct zobristTable initZobirstTable(struct zobristTableElement *table, size_t length) {
for(size_t i = 0; i < length; ++i) {
table[i].hash = 0;
}
return (struct zobristTable){table, length};
}