70 void ucx_list_free_a(UcxAllocator *alloc, UcxList *l) { |
70 void ucx_list_free_a(UcxAllocator *alloc, UcxList *l) { |
71 UcxList *e = l, *f; |
71 UcxList *e = l, *f; |
72 while (e != NULL) { |
72 while (e != NULL) { |
73 f = e; |
73 f = e; |
74 e = e->next; |
74 e = e->next; |
75 alloc->free(alloc->pool, f); |
75 alfree(alloc, f); |
76 } |
76 } |
77 } |
77 } |
78 |
78 |
79 UcxList *ucx_list_append(UcxList *l, void *data) { |
79 UcxList *ucx_list_append(UcxList *l, void *data) { |
80 return ucx_list_append_a(ucx_default_allocator(), l, data); |
80 return ucx_list_append_a(ucx_default_allocator(), l, data); |
81 } |
81 } |
82 |
82 |
83 UcxList *ucx_list_append_a(UcxAllocator *alloc, UcxList *l, void *data) { |
83 UcxList *ucx_list_append_a(UcxAllocator *alloc, UcxList *l, void *data) { |
84 UcxList *nl = (UcxList*) alloc->malloc(alloc->pool, sizeof(UcxList)); |
84 UcxList *nl = (UcxList*) almalloc(alloc, sizeof(UcxList)); |
85 if (!nl) { |
85 if (!nl) { |
86 return NULL; |
86 return NULL; |
87 } |
87 } |
88 |
88 |
89 nl->data = data; |
89 nl->data = data; |