Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit bc3533f

Browse files
committed
Disable buffering on jitstdout.
This avoid the need to call fflush() throughout the code.
1 parent b464dc3 commit bc3533f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/jit/ee_il_dll.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ void __stdcall jitStartup(ICorJitHost* jitHost)
7676
_setmode(jitstdoutFd, _O_TEXT);
7777
jitstdout = _fdopen(jitstdoutFd, "w");
7878
assert(jitstdout != nullptr);
79+
80+
// Prevent the FILE* from buffering its output in order to avoid calls to
81+
// `fflush()` throughout the code.
82+
setvbuf(jitstdout, nullptr, _IONBF, 0);
7983
}
8084
#endif
8185

0 commit comments

Comments
 (0)