mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Use calloc() in TranspositionTable::set_size()
Function calloc() already initializes memory to zero, so avoid calling clear() afterwards. Also some renaming while there (inspired by DiscoCheck). No functional change.
This commit is contained in:
@@ -570,9 +570,9 @@ namespace {
|
||||
&& tte
|
||||
&& tte->depth() >= depth
|
||||
&& ttValue != VALUE_NONE // Only in case of TT access race
|
||||
&& ( PvNode ? tte->type() == BOUND_EXACT
|
||||
: ttValue >= beta ? (tte->type() & BOUND_LOWER)
|
||||
: (tte->type() & BOUND_UPPER)))
|
||||
&& ( PvNode ? tte->bound() == BOUND_EXACT
|
||||
: ttValue >= beta ? (tte->bound() & BOUND_LOWER)
|
||||
: (tte->bound() & BOUND_UPPER)))
|
||||
{
|
||||
TT.refresh(tte);
|
||||
ss->currentMove = ttMove; // Can be MOVE_NONE
|
||||
@@ -601,8 +601,8 @@ namespace {
|
||||
|
||||
// Can ttValue be used as a better position evaluation?
|
||||
if (ttValue != VALUE_NONE)
|
||||
if ( ((tte->type() & BOUND_LOWER) && ttValue > eval)
|
||||
|| ((tte->type() & BOUND_UPPER) && ttValue < eval))
|
||||
if ( ((tte->bound() & BOUND_LOWER) && ttValue > eval)
|
||||
|| ((tte->bound() & BOUND_UPPER) && ttValue < eval))
|
||||
eval = ttValue;
|
||||
}
|
||||
else
|
||||
@@ -775,7 +775,7 @@ split_point_start: // At split points actual search starts from here
|
||||
&& depth >= (PvNode ? 6 * ONE_PLY : 8 * ONE_PLY)
|
||||
&& ttMove != MOVE_NONE
|
||||
&& !excludedMove // Recursive singular search is not allowed
|
||||
&& (tte->type() & BOUND_LOWER)
|
||||
&& (tte->bound() & BOUND_LOWER)
|
||||
&& tte->depth() >= depth - 3 * ONE_PLY;
|
||||
|
||||
// Step 11. Loop through moves
|
||||
@@ -1172,9 +1172,9 @@ split_point_start: // At split points actual search starts from here
|
||||
if ( tte
|
||||
&& tte->depth() >= ttDepth
|
||||
&& ttValue != VALUE_NONE // Only in case of TT access race
|
||||
&& ( PvNode ? tte->type() == BOUND_EXACT
|
||||
: ttValue >= beta ? (tte->type() & BOUND_LOWER)
|
||||
: (tte->type() & BOUND_UPPER)))
|
||||
&& ( PvNode ? tte->bound() == BOUND_EXACT
|
||||
: ttValue >= beta ? (tte->bound() & BOUND_LOWER)
|
||||
: (tte->bound() & BOUND_UPPER)))
|
||||
{
|
||||
ss->currentMove = ttMove; // Can be MOVE_NONE
|
||||
return ttValue;
|
||||
@@ -1584,7 +1584,7 @@ split_point_start: // At split points actual search starts from here
|
||||
void RootMove::extract_pv_from_tt(Position& pos) {
|
||||
|
||||
StateInfo state[MAX_PLY_PLUS_2], *st = state;
|
||||
TTEntry* tte;
|
||||
const TTEntry* tte;
|
||||
int ply = 0;
|
||||
Move m = pv[0];
|
||||
|
||||
@@ -1617,7 +1617,7 @@ void RootMove::extract_pv_from_tt(Position& pos) {
|
||||
void RootMove::insert_pv_in_tt(Position& pos) {
|
||||
|
||||
StateInfo state[MAX_PLY_PLUS_2], *st = state;
|
||||
TTEntry* tte;
|
||||
const TTEntry* tte;
|
||||
int ply = 0;
|
||||
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user