Add console flushing

This commit is contained in:
Pavel Punegov
2020-07-17 11:51:34 +03:00
committed by Pavel Punegov
parent df926a86f2
commit 02ea97b609
4 changed files with 8 additions and 0 deletions
+1
View File
@@ -1859,6 +1859,7 @@ void deinitMemory(MemoryState* memoryState) {
konan::consoleErrorf(
"Memory leaks detected, %d objects leaked!\n"
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n", allocCount);
konan::consoleFlush();
konan::abort();
}
#endif // USE_GC
+5
View File
@@ -172,6 +172,11 @@ void consoleErrorf(const char* format, ...) {
consoleErrorUtf8(buffer, rv);
}
void consoleFlush() {
::fflush(stdout);
::fflush(stderr);
}
// Thread execution.
#if !KONAN_NO_THREADS
+1
View File
@@ -32,6 +32,7 @@ void consoleWriteUtf8(const void* utf8, uint32_t sizeBytes);
void consoleErrorUtf8(const void* utf8, uint32_t sizeBytes);
// Negative return value denotes that read wasn't successful.
int32_t consoleReadUtf8(void* utf8, uint32_t maxSizeBytes);
void consoleFlush();
// Process control.
RUNTIME_NORETURN void abort(void);
+1
View File
@@ -493,6 +493,7 @@ class State {
"Unfinished workers detected, %lu workers leaked!\n"
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n",
remainingNativeWorkers);
konan::consoleFlush();
konan::abort();
}
}