mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +08:00
remove blank line between function and it's description
- remove the blank line between the declaration of the function and it's comment, leads to better IDE support when hovering over a function to see it's description - remove the unnecessary duplication of the function name in the functions description - slightly refactored code for lsb, msb in bitboard.h There are still a few things we can be improved later on, move the description of a function where it was declared (instead of implemented) and add descriptions to functions which are behind macros ifdefs closes https://github.com/official-stockfish/Stockfish/pull/4840 No functional change
This commit is contained in:
16
src/tt.cpp
16
src/tt.cpp
@@ -33,9 +33,8 @@ namespace Stockfish {
|
||||
|
||||
TranspositionTable TT; // Our global transposition table
|
||||
|
||||
// TTEntry::save() populates the TTEntry with a new node's data, possibly
|
||||
// Populates the TTEntry with a new node's data, possibly
|
||||
// overwriting an old position. The update is not atomic and can be racy.
|
||||
|
||||
void TTEntry::save(Key k, Value v, bool pv, Bound b, Depth d, Move m, Value ev) {
|
||||
|
||||
// Preserve any existing move for the same position
|
||||
@@ -57,10 +56,9 @@ void TTEntry::save(Key k, Value v, bool pv, Bound b, Depth d, Move m, Value ev)
|
||||
}
|
||||
|
||||
|
||||
// TranspositionTable::resize() sets the size of the transposition table,
|
||||
// Sets the size of the transposition table,
|
||||
// measured in megabytes. Transposition table consists of a power of 2 number
|
||||
// of clusters and each cluster consists of ClusterSize number of TTEntry.
|
||||
|
||||
void TranspositionTable::resize(size_t mbSize) {
|
||||
|
||||
Threads.main()->wait_for_search_finished();
|
||||
@@ -80,9 +78,8 @@ void TranspositionTable::resize(size_t mbSize) {
|
||||
}
|
||||
|
||||
|
||||
// TranspositionTable::clear() initializes the entire transposition table to zero,
|
||||
// in a multi-threaded way.
|
||||
|
||||
// Initializes the entire transposition table to zero,
|
||||
// in a multi-threaded way.
|
||||
void TranspositionTable::clear() {
|
||||
|
||||
std::vector<std::thread> threads;
|
||||
@@ -109,13 +106,12 @@ void TranspositionTable::clear() {
|
||||
}
|
||||
|
||||
|
||||
// TranspositionTable::probe() looks up the current position in the transposition
|
||||
// Looks up the current position in the transposition
|
||||
// table. It returns true and a pointer to the TTEntry if the position is found.
|
||||
// Otherwise, it returns false and a pointer to an empty or least valuable TTEntry
|
||||
// to be replaced later. The replace value of an entry is calculated as its depth
|
||||
// minus 8 times its relative age. TTEntry t1 is considered more valuable than
|
||||
// TTEntry t2 if its replace value is greater than that of t2.
|
||||
|
||||
TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||
|
||||
TTEntry* const tte = first_entry(key);
|
||||
@@ -148,7 +144,7 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||
}
|
||||
|
||||
|
||||
// TranspositionTable::hashfull() returns an approximation of the hashtable
|
||||
// Returns an approximation of the hashtable
|
||||
// occupation during a search. The hash is x permill full, as per UCI protocol.
|
||||
|
||||
int TranspositionTable::hashfull() const {
|
||||
|
||||
Reference in New Issue
Block a user