X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=2c91d7789c4bb5bef69a61b44ff94b6af6c2d432;hb=9ecdfd24018722dc70fb0a448c1c9d731d6e30a2;hp=a4795c6a123e184fc7906785f678bc84a4e6c30f;hpb=bacb645939397c8f4f070e46093ae764df20e34c;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index a4795c6a..2c91d778 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -59,6 +59,10 @@ namespace { // Used for debugging SMP code. const bool FakeSplit = false; + // Fast lookup table of sliding pieces indexed by Piece + const bool Slidings[18] = { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1 }; + inline bool piece_is_slider(Piece p) { return Slidings[p]; } + // ThreadsManager class is used to handle all the threads related stuff in search, // init, starting, parking and, the most important, launching a slave thread at a // split point are what this class does. All the access to shared thread data is @@ -228,7 +232,10 @@ namespace { const Value EasyMoveMargin = Value(0x200); - /// Global variables + /// Namespace variables + + // Book object + Book OpeningBook; // Iteration counter int Iteration; @@ -1927,7 +1934,7 @@ split_point_start: // At split points actual search starts from here int t = current_search_time(); // Poll for input - if (Bioskey()) + if (data_available()) { // We are line oriented, don't read single chars std::string command; @@ -2307,7 +2314,7 @@ split_point_start: // At split points actual search starts from here if (!ok) { cout << "Failed to create thread number " << i << endl; - Application::exit_with_failure(); + exit(EXIT_FAILURE); } // Wait until the thread has finished launching and is gone to sleep