Lines Matching +full:- +full:i
2 * SPDX-License-Identifier: BSD-3-Clause
62 int i; in shuffle_order() local
63 for (i = 0; i < NUM_MALLOC; i++) in shuffle_order()
64 order[i] = i; in shuffle_order()
65 for (i = 0; i < NUM_MALLOC - 1; i++) { in shuffle_order()
66 int j = randint(NUM_MALLOC - 1 - i) + i + 1; in shuffle_order()
68 int t = order[i]; in shuffle_order()
69 order[i] = order[j]; in shuffle_order()
75 fill_block(int i) in fill_block() argument
77 block_data[i] = randint(256); in fill_block()
78 if (blocks[i]) in fill_block()
79 memset(blocks[i], block_data[i], block_size[i]); in fill_block()
83 reset_block(int i) in reset_block() argument
85 blocks[i] = NULL; in reset_block()
86 block_data[i] = 0; in reset_block()
87 block_size[i] = 0; in reset_block()
93 int i; in reset_blocks() local
95 for (i = 0; i < NUM_MALLOC; i++) in reset_blocks()
96 reset_block(i); in reset_blocks()
100 check_block(char *which, int i) in check_block() argument
102 size_t size = block_size[i]; in check_block()
103 uint8_t data = block_data[i]; in check_block()
104 uint8_t *block = blocks[i]; in check_block()
112 which, i, (unsigned) j); in check_block()
121 int i; in check_blocks() local
124 for (i = 0; i < NUM_MALLOC; i++) in check_blocks()
125 result += check_block(which, i); in check_blocks()
137 printf("non-free bytes in arena %zu free %zu\n", info.arena, info.fordblks); in check_malloc()
168 long i; in main() local
176 for (i = 0; i < NUM_MALLOC; i++) { in main()
197 #pragma GCC diagnostic ignored "-Walloc-size-larger-than=PTRDIFF_MAX" in main()
200 for (i = sizeof(size_t) * 8 - 2; i < (long) (sizeof(size_t) * 8); i++) { in main()
201 blocks[0] = malloc((size_t) 1 << i); in main()
214 for (i = -1; i >= -128; i--) { in main()
215 blocks[0] = malloc((size_t) i); in main()
218 printf("malloc size %ld succeeded\n", i); in main()
232 for (i = 0; i < NUM_MALLOC; i++) { in main()
234 block_size[i] = size; in main()
235 blocks[i] = malloc(size); in main()
237 fill_block(i); in main()
246 for (i = 0; i < NUM_MALLOC; i++) { in main()
248 int j = order[i]; in main()
249 in_use -= block_size[j]; in main()
260 for (i = 0; i < NUM_MALLOC; i++) { in main()
261 int j = order[i]; in main()
264 in_use -= block_size[j]; in main()
275 for (i = 0; i < NUM_MALLOC; i++) { in main()
279 block_size[i] = size; in main()
280 blocks[i] = memalign(align, size); in main()
282 if ((uintptr_t) blocks[i] & (align - 1)) { in main()
284 blocks[i], align, size); in main()
287 fill_block(i); in main()
294 for (i = 0; i < NUM_MALLOC; i++) { in main()
295 int j = order[i]; in main()
298 in_use -= block_size[j]; in main()