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(
|
konan::consoleErrorf(
|
||||||
"Memory leaks detected, %d objects leaked!\n"
|
"Memory leaks detected, %d objects leaked!\n"
|
||||||
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n", allocCount);
|
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n", allocCount);
|
||||||
|
konan::consoleFlush();
|
||||||
konan::abort();
|
konan::abort();
|
||||||
}
|
}
|
||||||
#endif // USE_GC
|
#endif // USE_GC
|
||||||
|
|||||||
@@ -172,6 +172,11 @@ void consoleErrorf(const char* format, ...) {
|
|||||||
consoleErrorUtf8(buffer, rv);
|
consoleErrorUtf8(buffer, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void consoleFlush() {
|
||||||
|
::fflush(stdout);
|
||||||
|
::fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
// Thread execution.
|
// Thread execution.
|
||||||
#if !KONAN_NO_THREADS
|
#if !KONAN_NO_THREADS
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ void consoleWriteUtf8(const void* utf8, uint32_t sizeBytes);
|
|||||||
void consoleErrorUtf8(const void* utf8, uint32_t sizeBytes);
|
void consoleErrorUtf8(const void* utf8, uint32_t sizeBytes);
|
||||||
// Negative return value denotes that read wasn't successful.
|
// Negative return value denotes that read wasn't successful.
|
||||||
int32_t consoleReadUtf8(void* utf8, uint32_t maxSizeBytes);
|
int32_t consoleReadUtf8(void* utf8, uint32_t maxSizeBytes);
|
||||||
|
void consoleFlush();
|
||||||
|
|
||||||
// Process control.
|
// Process control.
|
||||||
RUNTIME_NORETURN void abort(void);
|
RUNTIME_NORETURN void abort(void);
|
||||||
|
|||||||
@@ -493,6 +493,7 @@ class State {
|
|||||||
"Unfinished workers detected, %lu workers leaked!\n"
|
"Unfinished workers detected, %lu workers leaked!\n"
|
||||||
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n",
|
"Use `Platform.isMemoryLeakCheckerActive = false` to avoid this check.\n",
|
||||||
remainingNativeWorkers);
|
remainingNativeWorkers);
|
||||||
|
konan::consoleFlush();
|
||||||
konan::abort();
|
konan::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user