Code cleanup: srand, PVS warnings (#1974)

* Remove srand invocation

* PVS High priority fixes

* PVS High errors part 2

* Furi: heap tracing inheritance

* Furi add __builtin_unreachable to furi_thread_catch
This commit is contained in:
あく
2022-11-06 00:07:24 +09:00
committed by GitHub
parent 04e50c9f89
commit e8913f2e33
37 changed files with 76 additions and 85 deletions

View File

@@ -50,6 +50,7 @@ static int32_t __furi_thread_stdout_flush(FuriThread* thread);
__attribute__((__noreturn__)) void furi_thread_catch() {
asm volatile("nop"); // extra magic
furi_crash("You are doing it wrong");
__builtin_unreachable();
}
static void furi_thread_set_state(FuriThread* thread, FuriThreadState state) {
@@ -112,6 +113,12 @@ FuriThread* furi_thread_alloc() {
FuriThread* thread = malloc(sizeof(FuriThread));
thread->output.buffer = furi_string_alloc();
thread->is_service = false;
if(furi_thread_get_current_id()) {
FuriThread* parent = pvTaskGetThreadLocalStoragePointer(NULL, 0);
if(parent) thread->heap_trace_enabled = parent->heap_trace_enabled;
}
return thread;
}