mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Another take at TT alignment
This time revert to original version but using uintptr_t instead of size_t Suggested by Lucas. No functional change.
This commit is contained in:
parent
481eda4ca0
commit
d44ac0a485
1 changed files with 1 additions and 2 deletions
|
@ -50,8 +50,7 @@ void TranspositionTable::set_size(size_t mbSize) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Align table start address to a cache line
|
||||
for (char* c = (char*)mem; unsigned(table = (TTEntry*)(c)) % CACHE_LINE_SIZE; c++) {}
|
||||
table = (TTEntry*)((uintptr_t(mem) + CACHE_LINE_SIZE - 1) & ~(CACHE_LINE_SIZE - 1));
|
||||
clear(); // Operator new is not guaranteed to initialize memory to zero
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue