MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_stack_create

Function acl_stack_create

lib_acl/src/stdlib/common/acl_stack.c:158–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158ACL_STACK *acl_stack_create(int init_size)
159{
160 const char *myname = "acl_stack_create";
161 ACL_STACK *s;
162
163 init_size = init_size > 0 ? init_size : 1;
164
165 s = (ACL_STACK *) acl_default_calloc(__FILE__, __LINE__, 1, sizeof(ACL_STACK));
166 if (s == NULL) {
167 char ebuf[256];
168 acl_msg_fatal("%s(%d): can't calloc, error=%s",
169 myname, __LINE__, acl_last_strerror(ebuf, sizeof(ebuf)));
170 }
171
172 acl_stack_space(s, init_size);
173
174 s->push_back = stack_push_back;
175 s->push_front = stack_push_front;
176 s->pop_back = stack_pop_back;
177 s->pop_front = stack_pop_front;
178 s->iter_head = stack_iter_head;
179 s->iter_next = stack_iter_next;
180 s->iter_tail = stack_iter_tail;
181 s->iter_prev = stack_iter_prev;
182
183 return (s);
184}
185
186void acl_stack_clean(ACL_STACK *s, void (*free_fn)(void *))
187{

Callers 4

event_createFunction · 0.85
__stack_initFunction · 0.85
allocator_allocFunction · 0.85
acl_allocator_pool_addFunction · 0.85

Calls 4

acl_default_callocFunction · 0.85
acl_msg_fatalFunction · 0.85
acl_last_strerrorFunction · 0.85
acl_stack_spaceFunction · 0.85

Tested by 1

__stack_initFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…