summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eina/eina_list.c')
-rw-r--r--src/lib/eina/eina_list.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/eina/eina_list.c b/src/lib/eina/eina_list.c
index 844e387..d81bf6c 100644
--- a/src/lib/eina/eina_list.c
+++ b/src/lib/eina/eina_list.c
@@ -213,11 +213,11 @@ _eina_list_mempool_accounting_free(Eina_List_Accounting *accounting)
213} 213}
214 214
215static inline Eina_List * 215static inline Eina_List *
216_eina_list_mempool_list_new(EINA_UNUSED Eina_List *list) 216_eina_list_mempool_list_new(Eina_List *before, Eina_List *after)
217{ 217{
218 Eina_List *tmp; 218 Eina_List *tmp;
219 219
220 tmp = eina_mempool_malloc(_eina_list_mp, sizeof (Eina_List)); 220 tmp = eina_mempool_malloc_near(_eina_list_mp, before, after, sizeof (Eina_List));
221 if (!tmp) 221 if (!tmp)
222 return NULL; 222 return NULL;
223#ifdef EINA_LIST_MAGIC 223#ifdef EINA_LIST_MAGIC
@@ -585,7 +585,7 @@ eina_list_append(Eina_List *list, const void *data)
585{ 585{
586 Eina_List *l, *new_l; 586 Eina_List *l, *new_l;
587 587
588 new_l = _eina_list_mempool_list_new(list); 588 new_l = _eina_list_mempool_list_new(NULL, list);
589 if (!new_l) return list; 589 if (!new_l) return list;
590 590
591 new_l->next = NULL; 591 new_l->next = NULL;
@@ -619,7 +619,7 @@ eina_list_prepend(Eina_List *list, const void *data)
619{ 619{
620 Eina_List *new_l; 620 Eina_List *new_l;
621 621
622 new_l = _eina_list_mempool_list_new(list); 622 new_l = _eina_list_mempool_list_new(list, NULL);
623 if (!new_l) return list; 623 if (!new_l) return list;
624 624
625 new_l->prev = NULL; 625 new_l->prev = NULL;
@@ -680,7 +680,7 @@ eina_list_append_relative_list(Eina_List *list,
680 EINA_MAGIC_CHECK_LIST(relative, NULL); 680 EINA_MAGIC_CHECK_LIST(relative, NULL);
681#endif 681#endif
682 682
683 new_l = _eina_list_mempool_list_new(list); 683 new_l = _eina_list_mempool_list_new(relative, relative->next);
684 if (!new_l) return list; 684 if (!new_l) return list;
685 685
686 new_l->next = relative->next; 686 new_l->next = relative->next;
@@ -733,7 +733,7 @@ eina_list_prepend_relative_list(Eina_List *list,
733#ifdef EINA_LIST_MAGIC 733#ifdef EINA_LIST_MAGIC
734 EINA_MAGIC_CHECK_LIST(relative, NULL); 734 EINA_MAGIC_CHECK_LIST(relative, NULL);
735#endif 735#endif
736 new_l = _eina_list_mempool_list_new(list); 736 new_l = _eina_list_mempool_list_new(relative->prev, relative);
737 if (!new_l) return list; 737 if (!new_l) return list;
738 738
739 new_l->prev = relative->prev; 739 new_l->prev = relative->prev;