mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +00:00
Reformat some comments
Tests used to derive some Elo worth comments: https://tests.stockfishchess.org/tests/view/653cf6b7cc309ae83956263a https://tests.stockfishchess.org/tests/view/655250b7136acbc573534711 https://tests.stockfishchess.org/tests/view/65525767136acbc5735347b9 https://tests.stockfishchess.org/tests/view/65525aa1136acbc573534801 closes https://github.com/official-stockfish/Stockfish/pull/4879 No functional change
This commit is contained in:
+9
-10
@@ -393,8 +393,8 @@ void dbg_print() {
|
||||
}
|
||||
|
||||
|
||||
// Used to serialize access to std::cout to avoid multiple threads writing at
|
||||
// the same time.
|
||||
// Used to serialize access to std::cout
|
||||
// to avoid multiple threads writing at the same time.
|
||||
std::ostream& operator<<(std::ostream& os, SyncCout sc) {
|
||||
|
||||
static std::mutex m;
|
||||
@@ -558,7 +558,7 @@ void* aligned_large_pages_alloc(size_t allocSize) {
|
||||
constexpr size_t alignment = 4096; // assumed small page size
|
||||
#endif
|
||||
|
||||
// round up to multiples of alignment
|
||||
// Round up to multiples of alignment
|
||||
size_t size = ((allocSize + alignment - 1) / alignment) * alignment;
|
||||
void* mem = std_aligned_alloc(alignment, size);
|
||||
#if defined(MADV_HUGEPAGE)
|
||||
@@ -600,7 +600,7 @@ void bindThisThread(size_t) {}
|
||||
|
||||
#else
|
||||
|
||||
// Retrieves logical processor information using Windows specific
|
||||
// Retrieves logical processor information using Windows-specific
|
||||
// API and returns the best node id for the thread with index idx. Original
|
||||
// code from Texel by Peter Österlund.
|
||||
static int best_node(size_t idx) {
|
||||
@@ -660,8 +660,7 @@ static int best_node(size_t idx) {
|
||||
groups.push_back(n);
|
||||
|
||||
// In case a core has more than one logical processor (we assume 2) and we
|
||||
// have still threads to allocate, then spread them evenly across available
|
||||
// nodes.
|
||||
// still have threads to allocate, spread them evenly across available nodes.
|
||||
for (int t = 0; t < threads - cores; t++)
|
||||
groups.push_back(t % nodes);
|
||||
|
||||
@@ -731,7 +730,7 @@ std::string workingDirectory; // path of the working directory
|
||||
void init([[maybe_unused]] int argc, char* argv[]) {
|
||||
std::string pathSeparator;
|
||||
|
||||
// extract the path+name of the executable binary
|
||||
// Extract the path+name of the executable binary
|
||||
argv0 = argv[0];
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -747,14 +746,14 @@ void init([[maybe_unused]] int argc, char* argv[]) {
|
||||
pathSeparator = "/";
|
||||
#endif
|
||||
|
||||
// extract the working directory
|
||||
// Extract the working directory
|
||||
workingDirectory = "";
|
||||
char buff[40000];
|
||||
char* cwd = GETCWD(buff, 40000);
|
||||
if (cwd)
|
||||
workingDirectory = cwd;
|
||||
|
||||
// extract the binary directory path from argv0
|
||||
// Extract the binary directory path from argv0
|
||||
binaryDirectory = argv0;
|
||||
size_t pos = binaryDirectory.find_last_of("\\/");
|
||||
if (pos == std::string::npos)
|
||||
@@ -762,7 +761,7 @@ void init([[maybe_unused]] int argc, char* argv[]) {
|
||||
else
|
||||
binaryDirectory.resize(pos + 1);
|
||||
|
||||
// pattern replacement: "./" at the start of path is replaced by the working directory
|
||||
// Pattern replacement: "./" at the start of path is replaced by the working directory
|
||||
if (binaryDirectory.find("." + pathSeparator) == 0)
|
||||
binaryDirectory.replace(0, 1, workingDirectory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user