Remove buflib allocation names, part two

Remove allocation names from the buflib API and fix up all callers.

Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
This commit is contained in:
Aidan MacDonald 2022-10-15 23:55:39 +01:00
parent 3301c5aa6d
commit 1e9ad3ca0d
39 changed files with 69 additions and 115 deletions

View file

@ -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;