1
0
Fork 0
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:
Marco Costalba 2013-05-02 09:35:52 +02:00
parent 481eda4ca0
commit d44ac0a485

View file

@ -50,8 +50,7 @@ void TranspositionTable::set_size(size_t mbSize) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
// Align table start address to a cache line table = (TTEntry*)((uintptr_t(mem) + CACHE_LINE_SIZE - 1) & ~(CACHE_LINE_SIZE - 1));
for (char* c = (char*)mem; unsigned(table = (TTEntry*)(c)) % CACHE_LINE_SIZE; c++) {}
clear(); // Operator new is not guaranteed to initialize memory to zero clear(); // Operator new is not guaranteed to initialize memory to zero
} }