summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index fb8575e..6375094 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -425,11 +425,32 @@ static const char* bf_getname(int selected_item, void *data,
return buffer;
}
+static int bf_action_cb(int action, struct gui_synclist* list)
+{
+ if (action == ACTION_STD_OK)
+ {
+ splash(HZ/1, "Attempting a 64k allocation");
+ int handle = core_alloc("test", 64<<10);
+ splash(HZ/2, (handle > 0) ? "Success":"Fail");
+ /* for some reason simplelist doesn't allow adding items here if
+ * info.get_name is given, so use normal list api */
+ gui_synclist_set_nb_items(list, core_get_num_blocks());
+ if (handle > 0)
+ core_free(handle);
+ action = ACTION_REDRAW;
+ }
+ else if (action == ACTION_NONE)
+ action = ACTION_REDRAW;
+ return action;
+}
+
static bool dbg_buflib_allocs(void)
{
struct simplelist_info info;
simplelist_info_init(&info, "mem allocs", core_get_num_blocks(), NULL);
info.get_name = bf_getname;
+ info.action_callback = bf_action_cb;
+ info.timeout = HZ/2;
return simplelist_show_list(&info);
}