void call_deinit(void) { struct call *call, *ncall; /* current and next call */ for (call = STAILQ_FIRST(&free_callq); call != NULL; call = ncall, nfree_callq--) { ASSERT(nfree_callq > 0); ncall = STAILQ_NEXT(call, call_tqe); call_free(call); } ASSERT(nfree_callq == 0); }
int do_test (void) { void *ptr1 = malloc (SIZE); void *ptr2 = malloc (SIZE); /* Avoid unwanted output to TTY after an expected memory corruption. */ ignore_stderr(); call_free (ptr1); ptr1 = malloc (SIZE); /* Not reached. The return statement is to put ptr2 into use so that gcc doesn't optimize out that malloc call. */ return (ptr1 == ptr2); }