Lines Matching refs:ptr

78 	char *ptr = NULL;  in _test_no_mem_realloc()  local
81 reloc_ptr = realloc(ptr, BUF_LEN); in _test_no_mem_realloc()
118 char *ptr[64] = { NULL }; in ZTEST() local
132 for (size_t i = 0; i < ARRAY_SIZE(ptr); i++) { in ZTEST()
135 ptr[i] = malloc(sizeof *(ptr[i])); in ZTEST()
142 for (size_t i = 0; i < ARRAY_SIZE(ptr); i++) { in ZTEST()
143 free(ptr[i]); in ZTEST()
144 ptr[i] = NULL; in ZTEST()
147 for (size_t n = 0; n < ARRAY_SIZE(ptr); n++) { in ZTEST()
151 ptr[i] = malloc(sizeof *(ptr[i])); in ZTEST()
159 free(ptr[i]); in ZTEST()
160 ptr[i] = NULL; in ZTEST()
164 for (size_t n = 0; n < ARRAY_SIZE(ptr); n++) { in ZTEST()
167 ptr[n] = malloc(n); in ZTEST()
173 free(ptr[n]); in ZTEST()
174 ptr[n] = NULL; in ZTEST()
220 char *ptr = NULL; in ZTEST() local
223 ptr = malloc(orig_size); in ZTEST()
225 zassert_not_null((ptr), "malloc failed, errno: %d", errno); in ZTEST()
226 (void)memset(ptr, 'p', orig_size); in ZTEST()
228 reloc_ptr = realloc(ptr, new_size); in ZTEST()
231 ptr = reloc_ptr; in ZTEST()
234 zassert_true(((memcmp(ptr, filled_buf, BUF_LEN)) == 0), in ZTEST()
237 free(ptr); in ZTEST()
238 ptr = NULL; in ZTEST()
293 char *ptr = NULL; in ZTEST() local
296 cptr = reallocarray(ptr, TOO_BIG, sizeof(int)); in ZTEST()
297 zassert_is_null((ptr), "reallocarray failed, errno: %d", errno); in ZTEST()
301 ptr = malloc(orig_size); in ZTEST()
303 zassert_not_null((ptr), "malloc failed, errno: %d", errno); in ZTEST()
304 (void)memset(ptr, 'p', orig_size); in ZTEST()
306 char *reloc_ptr = reallocarray(ptr, 2, orig_size); in ZTEST()
309 zassert_not_null((ptr), "malloc/reallocarray failed, errno: %d", errno); in ZTEST()
310 ptr = reloc_ptr; in ZTEST()
313 zassert_true(((memcmp(ptr, filled_buf, BUF_LEN)) == 0), in ZTEST()
316 free(ptr); in ZTEST()
317 ptr = NULL; in ZTEST()
366 char *ptr = NULL; in _test_memalloc_max() local
368 ptr = malloc(TOO_BIG); in _test_memalloc_max()
369 zassert_is_null(ptr, "malloc passed unexpectedly"); in _test_memalloc_max()
370 free(ptr); in _test_memalloc_max()
371 ptr = NULL; in _test_memalloc_max()