[FL-2432], [FL-2487] Rework bt keys load and save (#1139)

* bt keys: rework load and save with saved_struct
* bt: rename bt keys storage functions
* furi_hal_nfc: allow context switch during emilation
* bt settings: rework with saved struct
* infrared: replace file worker with dialogs and storage
* Core, Loader: fix thread allocation tracking, much better, so wow.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
gornekich
2022-04-21 18:36:53 +03:00
committed by GitHub
parent df66f4f6ba
commit 7c692a9f36
16 changed files with 112 additions and 134 deletions

View File

@@ -171,7 +171,16 @@ size_t memmgr_heap_get_thread_memory(osThreadId_t thread_id) {
!MemmgrHeapAllocDict_end_p(alloc_dict_it);
MemmgrHeapAllocDict_next(alloc_dict_it)) {
MemmgrHeapAllocDict_itref_t* data = MemmgrHeapAllocDict_ref(alloc_dict_it);
leftovers += data->value;
if(data->key != 0) {
uint8_t* puc = (uint8_t*)data->key;
puc -= xHeapStructSize;
BlockLink_t* pxLink = (void*)puc;
if((pxLink->xBlockSize & xBlockAllocatedBit) != 0 &&
pxLink->pxNextFreeBlock == NULL) {
leftovers += data->value;
}
}
}
}
memmgr_heap_thread_trace_depth--;

View File

@@ -45,6 +45,7 @@ static void furi_thread_body(void* context) {
thread->ret = thread->callback(thread->context);
if(thread->heap_trace_enabled == true) {
osDelay(33);
thread->heap_size = memmgr_heap_get_thread_memory(thread_id);
memmgr_heap_disable_thread_trace(thread_id);
}