blueloveTH 3 ani în urmă
părinte
comite
c75cf86270
2 a modificat fișierele cu 3 adăugiri și 4 ștergeri
  1. 2 3
      src/main.cpp
  2. 1 1
      src/vm.h

+ 2 - 3
src/main.cpp

@@ -20,13 +20,12 @@ struct Timer{
 };
 
 VM* newVM(){
-    // disable buff of std::cout and std::cerr
-    std::cout.setf(std::ios::unitbuf);
-    std::cerr.setf(std::ios::unitbuf);
     VM* vm = createVM([](const char* str) { 
         std::cout << str;
+        std::cout.flush();
     }, [](const char* str) { 
         std::cerr << str;
+        std::cerr.flush();
     });
     return vm;
 }

+ 1 - 1
src/vm.h

@@ -668,7 +668,7 @@ private:
     std::stack<_Str> _cleanErrorAndGetSnapshots(){
         std::stack<_Str> snapshots;
         while (!callstack.empty()){
-            if(snapshots.size() < 10){
+            if(snapshots.size() < 8){
                 snapshots.push(callstack.top()->errorSnapshot());
             }
             callstack.pop();