Lines Matching refs:vl
64 pb_validate_add_buffer(struct pb_validate *vl, in pb_validate_add_buffer() argument
80 if(vl->used && vl->entries[vl->used - 1].buf == buf) { in pb_validate_add_buffer()
81 vl->entries[vl->used - 1].flags |= flags; in pb_validate_add_buffer()
86 if(vl->used == vl->size) { in pb_validate_add_buffer()
90 new_size = vl->size * 2; in pb_validate_add_buffer()
94 new_entries = (struct pb_validate_entry *)REALLOC(vl->entries, in pb_validate_add_buffer()
95 vl->size*sizeof(struct pb_validate_entry), in pb_validate_add_buffer()
100 memset(new_entries + vl->size, 0, (new_size - vl->size)*sizeof(struct pb_validate_entry)); in pb_validate_add_buffer()
102 vl->size = new_size; in pb_validate_add_buffer()
103 vl->entries = new_entries; in pb_validate_add_buffer()
106 assert(!vl->entries[vl->used].buf); in pb_validate_add_buffer()
107 pb_reference(&vl->entries[vl->used].buf, buf); in pb_validate_add_buffer()
108 vl->entries[vl->used].flags = flags; in pb_validate_add_buffer()
109 ++vl->used; in pb_validate_add_buffer()
116 pb_validate_foreach(struct pb_validate *vl, in pb_validate_foreach() argument
121 for(i = 0; i < vl->used; ++i) { in pb_validate_foreach()
123 ret = callback(vl->entries[i].buf, data); in pb_validate_foreach()
132 pb_validate_validate(struct pb_validate *vl) in pb_validate_validate() argument
136 for(i = 0; i < vl->used; ++i) { in pb_validate_validate()
138 ret = pb_validate(vl->entries[i].buf, vl, vl->entries[i].flags); in pb_validate_validate()
141 pb_validate(vl->entries[i].buf, NULL, 0); in pb_validate_validate()
151 pb_validate_fence(struct pb_validate *vl, in pb_validate_fence() argument
155 for(i = 0; i < vl->used; ++i) { in pb_validate_fence()
156 pb_fence(vl->entries[i].buf, fence); in pb_validate_fence()
157 pb_reference(&vl->entries[i].buf, NULL); in pb_validate_fence()
159 vl->used = 0; in pb_validate_fence()
164 pb_validate_destroy(struct pb_validate *vl) in pb_validate_destroy() argument
167 for(i = 0; i < vl->used; ++i) in pb_validate_destroy()
168 pb_reference(&vl->entries[i].buf, NULL); in pb_validate_destroy()
169 FREE(vl->entries); in pb_validate_destroy()
170 FREE(vl); in pb_validate_destroy()
177 struct pb_validate *vl; in pb_validate_create() local
179 vl = CALLOC_STRUCT(pb_validate); in pb_validate_create()
180 if (!vl) in pb_validate_create()
183 vl->size = PB_VALIDATE_INITIAL_SIZE; in pb_validate_create()
184 vl->entries = (struct pb_validate_entry *)CALLOC(vl->size, sizeof(struct pb_validate_entry)); in pb_validate_create()
185 if(!vl->entries) { in pb_validate_create()
186 FREE(vl); in pb_validate_create()
190 return vl; in pb_validate_create()