mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
Make list_push and list_remove functions rather than inline functions
to decrease size and avoid aliasing violations. * include/grub/list.h (grub_list_push): Move to ... * grub-core/kern/list.c (grub_list_push): ... here. Don't inline. * include/grub/list.h (grub_list_remove): Move to ... * grub-core/kern/list.c (grub_list_remove): ... here. Don't inline.
This commit is contained in:
1 parent
9d369087a9
commit
b00d7fb6c5
3 files changed
+33
-20
No files matched your search
@@ -68,3 +68,24 @@ grub_prio_list_insert (grub_prio_list_t *head, grub_prio_list_t nitem)
|
||||
if (! inactive)
|
||||
nitem->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE;
|
||||
}
|
||||
|
||||
void
|
||||
grub_list_push (grub_list_t *head, grub_list_t item)
|
||||
{
|
||||
item->prev = head;
|
||||
if (*head)
|
||||
(*head)->prev = &item->next;
|
||||
item->next = *head;
|
||||
*head = item;
|
||||
}
|
||||
|
||||
void
|
||||
grub_list_remove (grub_list_t item)
|
||||
{
|
||||
if (item->prev)
|
||||
*item->prev = item->next;
|
||||
if (item->next)
|
||||
item->next->prev = item->prev;
|
||||
item->next = 0;
|
||||
item->prev = 0;
|
||||
}
|
||||
Reference in new issue
Block a user