[FL-2274] Inventing streams and moving FFF to them (#981)

* Streams: string stream
* String stream: updated insert/delete api
* Streams: generic stream interface and string stream implementation
* Streams: helpers for insert and delete_and_insert
* FFF: now compatible with streams
* MinUnit: introduced tests with arguments
* FFF: stream access violation
* Streams: copy data between streams
* Streams: file stream
* FFF: documentation
* FFStream: documentation
* FFF: alloc as file
* MinUnit: support for nested tests
* Streams: changed delete_and_insert, now it returns success flag. Added ability dump stream inner parameters and data to cout.
* FFF: simplified file open function
* Streams: unit tests
* FFF: tests
* Streams: declare cache_size constant as define, to allow variable modified arrays
* FFF: lib moved to a separate folder
* iButton: new FFF
* RFID: new FFF
* Animations: new FFF
* IR: new FFF
* NFC: new FFF
* Flipper file format: delete lib
* U2F: new FFF
* Subghz: new FFF and streams
* Streams: read line
* Streams: split
* FuriCore: implement memset with extra asserts
* FuriCore: implement extra heap asserts without inventing memset
* Scene manager: protected access to the scene id stack with a size check
* NFC worker: dirty fix for issue where hal_nfc was busy on app start
* Furi: update allocator to erase memory on allocation. Replace furi_alloc with malloc.
* FuriCore: cleanup memmgr code.
* Furi HAL: furi_hal_init is split into critical and non-critical parts. The critical part is currently clock and console.
* Memmgr: added ability to track allocations and deallocations through console.
* FFStream: some speedup
* Streams, FF: minor fixes
* Tests: restore
* File stream: a slightly more thread-safe version of file_stream_delete_and_insert

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
SG
2022-02-19 05:53:46 +10:00
committed by GitHub
parent 242241987e
commit 274c12fc56
257 changed files with 4480 additions and 2657 deletions

View File

@@ -36,4 +36,4 @@ int32_t dialogs_srv(void* p) {
}
return 0;
}
}

View File

@@ -25,8 +25,7 @@ bool dialogs_app_process_module_file_select(const DialogsAppMessageDataFileSelec
bool ret = false;
Gui* gui = furi_record_open("gui");
DialogsAppFileSelectContext* file_select_context =
furi_alloc(sizeof(DialogsAppFileSelectContext));
DialogsAppFileSelectContext* file_select_context = malloc(sizeof(DialogsAppFileSelectContext));
file_select_context->lock = API_LOCK_INIT_LOCKED();
ViewHolder* view_holder = view_holder_alloc();
@@ -57,4 +56,4 @@ bool dialogs_app_process_module_file_select(const DialogsAppMessageDataFileSelec
furi_record_close("gui");
return ret;
}
}

View File

@@ -54,7 +54,7 @@ DialogMessageButton dialogs_app_process_module_message(const DialogsAppMessageDa
DialogMessageButton ret = DialogMessageButtonBack;
Gui* gui = furi_record_open("gui");
const DialogMessage* message = data->message;
DialogsAppMessageContext* message_context = furi_alloc(sizeof(DialogsAppMessageContext));
DialogsAppMessageContext* message_context = malloc(sizeof(DialogsAppMessageContext));
message_context->lock = API_LOCK_INIT_LOCKED();
ViewHolder* view_holder = view_holder_alloc();
@@ -100,7 +100,7 @@ DialogMessageButton dialogs_app_process_module_message(const DialogsAppMessageDa
}
DialogMessage* dialog_message_alloc() {
DialogMessage* message = furi_alloc(sizeof(DialogMessage));
DialogMessage* message = malloc(sizeof(DialogMessage));
return message;
}
@@ -150,4 +150,4 @@ void dialog_message_set_buttons(
message->left_button_text = left;
message->center_button_text = center;
message->right_button_text = right;
}
}

View File

@@ -21,7 +21,7 @@ static void view_holder_draw_callback(Canvas* canvas, void* context);
static void view_holder_input_callback(InputEvent* event, void* context);
ViewHolder* view_holder_alloc() {
ViewHolder* view_holder = furi_alloc(sizeof(ViewHolder));
ViewHolder* view_holder = malloc(sizeof(ViewHolder));
view_holder->view_port = view_port_alloc();
view_port_draw_callback_set(view_holder->view_port, view_holder_draw_callback, view_holder);
@@ -147,4 +147,4 @@ static void view_holder_input_callback(InputEvent* event, void* context) {
}
}
}
}
}