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 fb8575ec62..6375094225 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,
425 return buffer; 425 return buffer;
426} 426}
427 427
428static int bf_action_cb(int action, struct gui_synclist* list)
429{
430 if (action == ACTION_STD_OK)
431 {
432 splash(HZ/1, "Attempting a 64k allocation");
433 int handle = core_alloc("test", 64<<10);
434 splash(HZ/2, (handle > 0) ? "Success":"Fail");
435 /* for some reason simplelist doesn't allow adding items here if
436 * info.get_name is given, so use normal list api */
437 gui_synclist_set_nb_items(list, core_get_num_blocks());
438 if (handle > 0)
439 core_free(handle);
440 action = ACTION_REDRAW;
441 }
442 else if (action == ACTION_NONE)
443 action = ACTION_REDRAW;
444 return action;
445}
446
428static bool dbg_buflib_allocs(void) 447static bool dbg_buflib_allocs(void)
429{ 448{
430 struct simplelist_info info; 449 struct simplelist_info info;
431 simplelist_info_init(&info, "mem allocs", core_get_num_blocks(), NULL); 450 simplelist_info_init(&info, "mem allocs", core_get_num_blocks(), NULL);
432 info.get_name = bf_getname; 451 info.get_name = bf_getname;
452 info.action_callback = bf_action_cb;
453 info.timeout = HZ/2;
433 return simplelist_show_list(&info); 454 return simplelist_show_list(&info);
434} 455}
435 456