From 1e9ad3ca0d9bf3e917eb2beb460421155144760a Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 15 Oct 2022 23:55:39 +0100 Subject: Remove buflib allocation names, part two Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a --- apps/shortcuts.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/shortcuts.c') diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 3f13d0c1b3..2e10bad00f 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -128,8 +128,7 @@ static struct shortcut* get_shortcut(int index) if (first_handle == 0) { - first_handle = core_alloc_ex("shortcuts_head", - sizeof(struct shortcut_handle), &shortcut_ops); + first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); if (first_handle <= 0) return NULL; h = core_get_data(first_handle); @@ -146,11 +145,9 @@ static struct shortcut* get_shortcut(int index) } while (handle_count > 0 && current_handle > 0); if (handle_count > 0 && handle_index == 0) { - char buf[32]; - snprintf(buf, sizeof buf, "shortcuts_%d", index/SHORTCUTS_PER_HANDLE); /* prevent invalidation of 'h' during compaction */ ++buflib_move_lock; - h->next_handle = core_alloc_ex(buf, sizeof(struct shortcut_handle), &shortcut_ops); + h->next_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); --buflib_move_lock; if (h->next_handle <= 0) return NULL; @@ -390,7 +387,7 @@ void shortcuts_init(void) fd = open_utf8(SHORTCUTS_FILENAME, O_RDONLY); if (fd < 0) return; - first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops); + first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); if (first_handle <= 0) { close(fd); return; -- cgit v1.2.3