Lines Matching refs:allocated
197 check_allocated_intact(void **allocated, size_t n_alloc) {
199 void *ptr = *(void **)allocated[i];
202 if (ptr == allocated[j]) {
222 void **allocated = mallocx(n_alloc * sizeof(void *), flags);
223 assert_ptr_not_null(allocated, "Unexpected mallocx failure");
226 allocated[i] = mallocx(sizeof(void *) * 8, flags);
227 assert_ptr_not_null(allocated[i], "Unexpected mallocx failure");
230 *(void **)allocated[i] = allocated[i - 1];
233 *(void **)allocated[0] = allocated[n_alloc - 1];
234 expect_true(check_allocated_intact(allocated, n_alloc),
235 "Allocated data corrupted");
238 free(allocated[i]);
241 expect_false(check_allocated_intact(allocated, n_alloc),
246 allocated[i] = mallocx(sizeof(void *), flags);
247 assert_ptr_not_null(allocated[i], "Unexpected mallocx failure");
248 *(void **)allocated[i] = (void *)(uintptr_t)i;
252 free(allocated[i]);
253 *(void **)allocated[i] = NULL;