Add kernel memory functions & other memory-related changes (#590)
New Features - Added policy-based memory allocation APIs with capability flags and optional alignment: `memory_alloc_with_policy`, `memory_realloc_with_policy`, `memory_calloc_with_policy`, and `memory_free`. - Switched heap memory reporting to `memory_print_stats`. Bug Fixes - Improved allocation robustness with capability fallback behavior. - Added overflow-safe handling for aligned zero-initialized allocations. - Tightened const-correctness for generated device-tree device arrays. Tests - Added unit tests for default policy, alignment, zero-initialization, realloc preservation, freeing, and memory stats reporting.
This commit is contained in:
committed by
GitHub
parent
f21c0df6fe
commit
03a6285328
@@ -43,7 +43,7 @@ private:
|
||||
* @param dtsModules List of modules from devicetree, null-terminated, non-null parameter
|
||||
* @param dtsDevices Array that is terminated with DTS_DEVICE_TERMINATOR
|
||||
*/
|
||||
void run(Module* dtsModules[], DtsDevice dtsDevices[]);
|
||||
void run(Module* const dtsModules[], const DtsDevice dtsDevices[]);
|
||||
|
||||
/** Provides access to the dispatcher that runs on the main task.
|
||||
* @warning This dispatcher is used for WiFi and might block for some time during WiFi connection.
|
||||
|
||||
@@ -371,7 +371,7 @@ static void onLvglStarted() {
|
||||
addService(service::screenshot::manifest);
|
||||
#endif
|
||||
|
||||
memory_trace();
|
||||
memory_print_stats();
|
||||
}
|
||||
|
||||
static void onLvglStopped() {
|
||||
@@ -388,10 +388,10 @@ static void onLvglStopped() {
|
||||
check(service::removeService(service::statusbar::manifest.id));
|
||||
check(service::removeService(service::gui::manifest.id));
|
||||
|
||||
memory_trace();
|
||||
memory_print_stats();
|
||||
}
|
||||
|
||||
void run(Module* dtsModules[], DtsDevice dtsDevices[]) {
|
||||
void run(Module* const dtsModules[], const DtsDevice dtsDevices[]) {
|
||||
LOG_I(TAG, "Tactility v%s on %s (%s)", TT_VERSION, CONFIG_TT_DEVICE_NAME, CONFIG_TT_DEVICE_ID);
|
||||
|
||||
LOG_I(TAG, "Initializing kernel");
|
||||
|
||||
@@ -69,7 +69,7 @@ void LoaderService::onStartAppMessage(const std::string& id, app::LaunchId launc
|
||||
transitionAppToState(new_app, app::State::Created);
|
||||
transitionAppToState(new_app, app::State::Showing);
|
||||
|
||||
memory_trace();
|
||||
memory_print_stats();
|
||||
}
|
||||
|
||||
void LoaderService::onStopTopAppMessage(const std::string& id) {
|
||||
@@ -162,7 +162,7 @@ void LoaderService::onStopTopAppMessage(const std::string& id) {
|
||||
}
|
||||
}
|
||||
|
||||
memory_trace();
|
||||
memory_print_stats();
|
||||
}
|
||||
|
||||
int LoaderService::findAppInStack(const std::string& id) const {
|
||||
|
||||
Reference in New Issue
Block a user