Lines Matching refs:data
42 * Also, size <= capacity and data != 0 if and only if capacity != 0
43 * capacity will always be the allocation size of data
48 void *data;
63 if (buf->data) {
65 ralloc_free(buf->data);
67 free(buf->data);
86 void *data;
89 data = reralloc_size(buf->mem_ctx, buf->data, capacity);
91 data = realloc(buf->data, capacity);
93 if (!data)
96 buf->data = data;
100 return (void *)((char *)buf->data + buf->size);
126 memcpy(buf->data, from_buf->data, from_buf->size);
154 buf->data = reralloc_size(buf->mem_ctx, buf->data, buf->size);
156 buf->data = realloc(buf->data, buf->size);
161 ralloc_free(buf->data);
163 free(buf->data);
165 buf->data = NULL;
175 #define util_dynarray_top_ptr(buf, type) (type*)((char*)(buf)->data + (buf)->size - sizeof(type))
177 #define util_dynarray_pop_ptr(buf, type) (type*)((char*)(buf)->data + ((buf)->size -= sizeof(type)))
180 #define util_dynarray_element(buf, type, idx) ((type*)(buf)->data + (idx))
181 #define util_dynarray_begin(buf) ((buf)->data)
186 for (type *elem = (type *)(buf)->data; \
187 elem < (type *)((char *)(buf)->data + (buf)->size); elem++)
193 elem = elem > (type *)(buf)->data ? elem - 1 : NULL)