Add console flushing
This commit is contained in:
committed by
Pavel Punegov
parent
df926a86f2
commit
02ea97b609
@@ -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
|
||||
|
||||
@@ -172,6 +172,11 @@ void consoleErrorf(const char* format, ...) {
|
||||
consoleErrorUtf8(buffer, rv);
|
||||
}
|
||||
|
||||
void consoleFlush() {
|
||||
::fflush(stdout);
|
||||
::fflush(stderr);
|
||||
}
|
||||
|
||||
// Thread execution.
|
||||
#if !KONAN_NO_THREADS
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user