]> git.sesse.net Git - stockfish/blobdiff - src/main.cpp
Don't sync with C library I/O buffers
[stockfish] / src / main.cpp
index 0c94ed892bfc669b6bcf1727c78910b3698a9bd7..1b2fdf9dec5efff93d657b46ff042b31ef516254 100644 (file)
@@ -43,6 +43,11 @@ int main(int argc, char* argv[]) {
   Eval::init();
   TT.set_size(Options["Hash"]);
 
   Eval::init();
   TT.set_size(Options["Hash"]);
 
+  // Don't sync with C library I/O buffers, faster but now using printf()
+  // or scanf() could yield to issues because buffers are independent.
+  cout.sync_with_stdio(false);
+  cin.sync_with_stdio(false);
+
   cout << engine_info() << endl;
 
   if (argc == 1)
   cout << engine_info() << endl;
 
   if (argc == 1)