7
struct Structy { char data[100]; int x; };
11
char* allocations[NUM];
12
for (int i = 0; i < NUM/2; i++) {
13
allocations[i] = (char*){{{ NEW }}};
14
assert(allocations[i]);
15
if (i > 10 && i%4 == 1 && allocations[i-10]) {
16
{{{ DELETE }}}(allocations[i-10]);
17
allocations[i-10] = NULL;
20
for (int i = NUM/2; i < NUM; i++) {
21
allocations[i] = (char*){{{ NEW }}};
22
assert(allocations[i]);
23
if (i > 10 && i%4 != 1 && allocations[i-10]) {
24
{{{ DELETE }}}(allocations[i-10]);
25
allocations[i-10] = NULL;
28
char* first = allocations[0];
29
for (int i = 0; i < NUM; i++) {
31
{{{ DELETE }}}(allocations[i]);
34
char *last = (char*){{{ NEW }}}; /* should be identical, as we free'd it all */
35
char *newer = (char*){{{ NEW }}}; /* should be different */
36
printf("*%d,%d*\n", first == last, first == newer);