Lines Matching refs:p

5 	void *p;  in TEST_BEGIN()  local
8 p = mallocx(42, 0); in TEST_BEGIN()
9 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
10 sz = sallocx(p, 0); in TEST_BEGIN()
12 tsz = xallocx(p, sz, 0, 0); in TEST_BEGIN()
15 dallocx(p, 0); in TEST_BEGIN()
21 void *p; in TEST_BEGIN() local
24 p = mallocx(42, 0); in TEST_BEGIN()
25 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
26 sz = sallocx(p, 0); in TEST_BEGIN()
28 tsz = xallocx(p, sz, sz-42, 0); in TEST_BEGIN()
31 dallocx(p, 0); in TEST_BEGIN()
37 void *p; in TEST_BEGIN() local
40 p = mallocx(42, 0); in TEST_BEGIN()
41 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
42 sz = sallocx(p, 0); in TEST_BEGIN()
44 tsz = xallocx(p, sz + 5, 0, 0); in TEST_BEGIN()
47 dallocx(p, 0); in TEST_BEGIN()
128 void *p; in TEST_BEGIN() local
134 p = mallocx(small0, 0); in TEST_BEGIN()
135 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
138 assert_zu_eq(xallocx(p, 1, 0, 0), small0, in TEST_BEGIN()
142 assert_zu_le(xallocx(p, hugemax, 0, 0), hugemax, in TEST_BEGIN()
146 assert_zu_le(xallocx(p, hugemax+1, 0, 0), hugemax, in TEST_BEGIN()
148 assert_zu_le(xallocx(p, SIZE_T_MAX, 0, 0), hugemax, in TEST_BEGIN()
151 dallocx(p, 0); in TEST_BEGIN()
158 void *p; in TEST_BEGIN() local
164 p = mallocx(small0, 0); in TEST_BEGIN()
165 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
168 assert_zu_le(xallocx(p, hugemax-1, 2, 0), hugemax, in TEST_BEGIN()
170 assert_zu_le(xallocx(p, hugemax, 1, 0), hugemax, in TEST_BEGIN()
174 assert_zu_le(xallocx(p, hugemax+1, 2, 0), hugemax, in TEST_BEGIN()
176 assert_zu_le(xallocx(p, hugemax+2, 3, 0), hugemax, in TEST_BEGIN()
178 assert_zu_le(xallocx(p, SIZE_T_MAX-2, 2, 0), hugemax, in TEST_BEGIN()
180 assert_zu_le(xallocx(p, SIZE_T_MAX-1, 1, 0), hugemax, in TEST_BEGIN()
183 dallocx(p, 0); in TEST_BEGIN()
190 void *p; in TEST_BEGIN() local
197 p = mallocx(small0, 0); in TEST_BEGIN()
198 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
200 assert_zu_eq(xallocx(p, small1, 0, 0), small0, in TEST_BEGIN()
203 assert_zu_eq(xallocx(p, small1, 0, 0), small0, in TEST_BEGIN()
206 assert_zu_eq(xallocx(p, small0, small1 - small0, 0), small0, in TEST_BEGIN()
210 assert_zu_eq(xallocx(p, small0, hugemax - small0 + 1, 0), small0, in TEST_BEGIN()
212 assert_zu_eq(xallocx(p, small0, SIZE_T_MAX - small0, 0), small0, in TEST_BEGIN()
215 dallocx(p, 0); in TEST_BEGIN()
222 void *p; in TEST_BEGIN() local
232 p = mallocx(large2, 0); in TEST_BEGIN()
233 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
235 assert_zu_eq(xallocx(p, large2, 0, 0), large2, in TEST_BEGIN()
238 assert_zu_eq(xallocx(p, large0, 0, 0), large0, in TEST_BEGIN()
240 assert_zu_eq(xallocx(p, smallmax, 0, 0), large0, in TEST_BEGIN()
243 assert_zu_eq(xallocx(p, large2, 0, 0), large2, in TEST_BEGIN()
246 assert_zu_eq(xallocx(p, large0, large2 - large0, 0), large2, in TEST_BEGIN()
248 assert_zu_eq(xallocx(p, large1, large2 - large1, 0), large2, in TEST_BEGIN()
250 assert_zu_eq(xallocx(p, large0, large1 - large0, 0), large1, in TEST_BEGIN()
252 assert_zu_eq(xallocx(p, smallmax, large0 - smallmax, 0), large0, in TEST_BEGIN()
255 assert_zu_eq(xallocx(p, large0, 0, 0), large0, in TEST_BEGIN()
258 assert_zu_eq(xallocx(p, large2, 0, 0), large2, in TEST_BEGIN()
260 assert_zu_eq(xallocx(p, huge0, 0, 0), large2, in TEST_BEGIN()
263 assert_zu_eq(xallocx(p, large0, 0, 0), large0, in TEST_BEGIN()
266 assert_zu_lt(xallocx(p, large0, huge0 - large0, 0), huge0, in TEST_BEGIN()
269 assert_zu_eq(xallocx(p, large0, 0, 0), large0, in TEST_BEGIN()
272 assert_zu_eq(xallocx(p, large0, large2 - large0, 0), large2, in TEST_BEGIN()
275 assert_zu_eq(xallocx(p, large2, 0, 0), large2, in TEST_BEGIN()
278 assert_zu_lt(xallocx(p, large2, hugemax - large2 + 1, 0), huge0, in TEST_BEGIN()
281 dallocx(p, 0); in TEST_BEGIN()
288 void *p; in TEST_BEGIN() local
297 p = mallocx(huge2, 0); in TEST_BEGIN()
298 assert_ptr_not_null(p, "Unexpected mallocx() error"); in TEST_BEGIN()
300 assert_zu_eq(xallocx(p, huge2, 0, 0), huge2, in TEST_BEGIN()
303 assert_zu_ge(xallocx(p, huge0, 0, 0), huge0, in TEST_BEGIN()
305 assert_zu_ge(xallocx(p, largemax, 0, 0), huge0, in TEST_BEGIN()
308 assert_zu_eq(xallocx(p, huge2, 0, 0), huge2, in TEST_BEGIN()
311 assert_zu_eq(xallocx(p, huge0, huge2 - huge0, 0), huge2, in TEST_BEGIN()
313 assert_zu_eq(xallocx(p, huge1, huge2 - huge1, 0), huge2, in TEST_BEGIN()
315 assert_zu_eq(xallocx(p, huge0, huge1 - huge0, 0), huge1, in TEST_BEGIN()
317 assert_zu_ge(xallocx(p, largemax, huge0 - largemax, 0), huge0, in TEST_BEGIN()
320 assert_zu_ge(xallocx(p, huge0, 0, 0), huge0, in TEST_BEGIN()
323 assert_zu_le(xallocx(p, huge2, 0, 0), huge2, in TEST_BEGIN()
325 assert_zu_le(xallocx(p, hugemax+1, 0, 0), huge2, in TEST_BEGIN()
328 assert_zu_ge(xallocx(p, huge0, 0, 0), huge0, in TEST_BEGIN()
331 assert_zu_le(xallocx(p, huge0, SIZE_T_MAX - huge0, 0), hugemax, in TEST_BEGIN()
334 assert_zu_ge(xallocx(p, huge0, 0, 0), huge0, in TEST_BEGIN()
337 assert_zu_le(xallocx(p, huge0, huge2 - huge0, 0), huge2, in TEST_BEGIN()
340 assert_zu_eq(xallocx(p, huge2, 0, 0), huge2, in TEST_BEGIN()
343 assert_zu_le(xallocx(p, huge2, hugemax - huge2 + 1, 0), hugemax, in TEST_BEGIN()
346 dallocx(p, 0); in TEST_BEGIN()
351 print_filled_extents(const void *p, uint8_t c, size_t len) in print_filled_extents() argument
353 const uint8_t *pc = (const uint8_t *)p; in print_filled_extents()
357 malloc_printf(" p=%p, c=%#x, len=%zu:", p, c, len); in print_filled_extents()
371 validate_fill(const void *p, uint8_t c, size_t offset, size_t len) in validate_fill() argument
373 const uint8_t *pc = (const uint8_t *)p; in validate_fill()
383 print_filled_extents(p, c, offset + len); in validate_fill()
392 void *p; in test_zero() local
396 p = mallocx(sz, MALLOCX_ZERO); in test_zero()
397 assert_ptr_not_null(p, "Unexpected mallocx() error"); in test_zero()
398 assert_false(validate_fill(p, 0x00, 0, sz), "Memory not filled: sz=%zu", in test_zero()
405 memset(p, FILL_BYTE, sz); in test_zero()
406 assert_false(validate_fill(p, FILL_BYTE, 0, sz), in test_zero()
411 assert_zu_eq(xallocx(p, sz, 0, MALLOCX_ZERO), sz, in test_zero()
413 assert_false(validate_fill(p, FILL_BYTE, 0, sz), in test_zero()
418 assert_zu_eq(xallocx(p, sz+1, 0, MALLOCX_ZERO), nsz, in test_zero()
420 assert_false(validate_fill(p, FILL_BYTE, 0, sz), in test_zero()
422 assert_false(validate_fill(p, 0x00, sz, nsz-sz), in test_zero()
424 memset((void *)((uintptr_t)p + sz), FILL_BYTE, nsz-sz); in test_zero()
425 assert_false(validate_fill(p, FILL_BYTE, 0, nsz), in test_zero()
429 dallocx(p, 0); in test_zero()