Lines Matching refs:size
42 * Also, size <= capacity and data != 0 if and only if capacity != 0
43 * capacity will always be the allocation size of data
49 unsigned size;
76 buf->size = 0;
100 return (void *)((char *)buf->data + buf->size);
115 buf->size = newsize;
125 if (util_dynarray_resize_bytes(buf, from_buf->size, 1))
126 memcpy(buf->data, from_buf->data, from_buf->size);
135 growbytes > UINT_MAX - buf->size))
138 unsigned newsize = buf->size + growbytes;
143 buf->size = newsize;
151 if (buf->size != buf->capacity) {
152 if (buf->size) {
154 buf->data = reralloc_size(buf->mem_ctx, buf->data, buf->size);
156 buf->data = realloc(buf->data, buf->size);
158 buf->capacity = buf->size;
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)))
179 #define util_dynarray_contains(buf, type) ((buf)->size >= sizeof(type))
182 #define util_dynarray_end(buf) ((void*)util_dynarray_element((buf), char, (buf)->size))
183 #define util_dynarray_num_elements(buf, type) ((buf)->size / sizeof(type))
187 elem < (type *)((char *)(buf)->data + (buf)->size); elem++)
190 if ((buf)->size > 0) \
197 unsigned num_elements = (buf)->size / sizeof(type); \