Language guarantees that c'tor is called, but without any c'tor
it happens to work by accident because OS zeroes out the freshly
allocated pages. The problem is that if I deallocate and allocate
again, the second time pages are no more newly come by the OS and
so could contain stale info.
A practical case could be if we change TT size or numbers of
threads on the fly while already running.
Bug spotted by Justin Blanchard.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
<< " bytes for material hash table." << endl;
Application::exit_with_failure();
}
+ memset(entries, 0, MaterialTableSize * sizeof(MaterialInfo));
}
MaterialInfoTable::~MaterialInfoTable() {
<< " bytes for pawn hash table." << std::endl;
Application::exit_with_failure();
}
+ memset(entries, 0, PawnTableSize * sizeof(PawnInfo));
}
<< " MB for transposition table." << std::endl;
Application::exit_with_failure();
}
+ clear();
}
}