X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.cpp;h=c6b294a00cad8fd5aeb1eae1bf673b53b3f4026a;hp=271b98b74009eaf8f7e5e6601c5225c33a5be7f5;hb=d44ac0a4850f389ee2fdb8812104150c323d9ec2;hpb=481eda4ca0121cfa16f5a29f364ca30ee2852409 diff --git a/src/tt.cpp b/src/tt.cpp index 271b98b7..c6b294a0 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -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 }