Lines Matching full:blocks
60 * @details The test allocates 4 blocks from heap memory pool
63 * validates k_free() API by freeing up all the blocks which were
172 * the API will return NULL. The 8 blocks of memory of
175 * blocks are memset to 0 and read/write is allowed. The test is then
176 * teared up by freeing all the blocks allocated.
319 char *blocks[N_MULTI_HEAPS]; in ZTEST() local
331 blocks[i] = sys_multi_heap_alloc(&multi_heap, (void *)(long)i, in ZTEST()
334 zassert_not_null(blocks[i], "allocation failed"); in ZTEST()
335 zassert_true(blocks[i] >= &heap_mem[i][0] && in ZTEST()
336 blocks[i] < &heap_mem[i+1][0], in ZTEST()
340 blocks[i], MHEAP_BYTES / 2); in ZTEST()
342 zassert_equal(ptr, blocks[i], "realloc moved pointer"); in ZTEST()
353 /* Free all blocks */ in ZTEST()
355 sys_multi_heap_free(&multi_heap, blocks[i]); in ZTEST()
360 blocks[i] = sys_multi_heap_alloc(&multi_heap, (void *)(long)i, in ZTEST()
362 zassert_not_null(blocks[i], "final re-allocation failed"); in ZTEST()
366 blocks[i], MHEAP_BYTES / 4); in ZTEST()
367 zassert_equal(ptr, blocks[i], "realloc should return same value"); in ZTEST()
371 zassert_between_inclusive((uintptr_t)ptr, (uintptr_t)blocks[i] + MHEAP_BYTES / 4, in ZTEST()
372 (uintptr_t)blocks[i] + MHEAP_BYTES / 2 - 1, in ZTEST()
378 blocks[0], /* size = */ 0); in ZTEST()