Browse Source

Remove all flushes

Christoph Stelz 3 months ago
parent
commit
667724addb
1 changed files with 0 additions and 6 deletions
  1. 0 6
      src/ipc_debug.cpp

+ 0 - 6
src/ipc_debug.cpp

@@ -91,21 +91,18 @@ void debug_ipc_init() {
 /** Communicate assertion result to client and possibly hang if assertion failed
  */
 inline void handle_assertion(bool assertion_status = true) {
-    fflush(debug_ipc_file); // make sure the comparison is done
     if (!debug_ipc_response_file)
         return;
 
     char res = assertion_status ? 1 : 0;
     if (debug_ipc_is_root) {
         fwrite(&res, 1, 1, debug_ipc_response_file);
-        fflush(debug_ipc_response_file);
     } else {
         fread(&res, 1, 1, debug_ipc_response_file);
     }
 
     if (res == 0) {
         std::cout << "[IPCDBG] Entering endless loop, attach debugger to PID " << getpid();
-        fflush(stdout);
         while (1) {
             sleep(1);
         }
@@ -140,7 +137,6 @@ void debug_ipc_assert_equal(T value) {
         handle_assertion(other_value == value);
     } else {
         size_t written = fwrite(&value, expected_size, 1, debug_ipc_file);
-        fflush(debug_ipc_file);
 
         if (written != 1) {
             printf("[IPCDBG] Could not write enough bytes. Error: %s\n", strerror(errno));
@@ -185,7 +181,6 @@ void debug_ipc_assert_equal_vector(std::vector<T> value) {
         handle_assertion(items_equal);
     } else {
         fwrite(value.data(), 1, array_byte_length, debug_ipc_file);
-        fflush(debug_ipc_file);
         handle_assertion();
     }
 }
@@ -245,7 +240,6 @@ void debug_ipc_assert_equal_array(void *value, size_t size) {
         handle_assertion(items_equal);
     } else {
         size_t written = fwrite(value, 1, size, debug_ipc_file);
-        fflush(debug_ipc_file);
 
         if (written != size) {
             printf("[IPCDBG] Could not write enough bytes. Error: %s\n", strerror(errno));