[FL-2975] Bug fixes and improvements: Furi, Input, Cli (#2004)
* Furi: configurable heap allocation tracking * Furi: relax restriction in thread heap setter asserts, apply heap tracking setting on app start instead of thread allocation * Furi: hide dangerous heap tracking levels in release build * Input: fix non-working debounce
This commit is contained in:
@@ -122,9 +122,14 @@ FuriThread* furi_thread_alloc() {
|
||||
thread->output.buffer = furi_string_alloc();
|
||||
thread->is_service = false;
|
||||
|
||||
if(furi_thread_get_current_id()) {
|
||||
FuriHalRtcHeapTrackMode mode = furi_hal_rtc_get_heap_track_mode();
|
||||
if(mode == FuriHalRtcHeapTrackModeAll) {
|
||||
thread->heap_trace_enabled = true;
|
||||
} else if(mode == FuriHalRtcHeapTrackModeTree && furi_thread_get_current_id()) {
|
||||
FuriThread* parent = pvTaskGetThreadLocalStoragePointer(NULL, 0);
|
||||
if(parent) thread->heap_trace_enabled = parent->heap_trace_enabled;
|
||||
} else {
|
||||
thread->heap_trace_enabled = false;
|
||||
}
|
||||
|
||||
return thread;
|
||||
@@ -243,14 +248,12 @@ FuriThreadId furi_thread_get_id(FuriThread* thread) {
|
||||
void furi_thread_enable_heap_trace(FuriThread* thread) {
|
||||
furi_assert(thread);
|
||||
furi_assert(thread->state == FuriThreadStateStopped);
|
||||
furi_assert(thread->heap_trace_enabled == false);
|
||||
thread->heap_trace_enabled = true;
|
||||
}
|
||||
|
||||
void furi_thread_disable_heap_trace(FuriThread* thread) {
|
||||
furi_assert(thread);
|
||||
furi_assert(thread->state == FuriThreadStateStopped);
|
||||
furi_assert(thread->heap_trace_enabled == true);
|
||||
thread->heap_trace_enabled = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user