2 #include <ccan/tal/tal.h>
3 #include <ccan/tal/tal.c>
4 #include <ccan/tap/tap.h>
6 static size_t num_allocated;
8 static void *alloc_account(size_t len)
14 static void free_account(void *p)
20 #define NUM_ALLOCS 1000
24 void *p, *c[NUM_ALLOCS];
26 size_t allocated_after_first;
30 tal_set_backend(alloc_account, NULL, free_account, NULL);
35 allocated_after_first = num_allocated;
36 for (i = 1; i < NUM_ALLOCS; i++)
39 /* Now free them all. */
40 for (i = 0; i < NUM_ALLOCS; i++)
43 /* We can expect some residue from having any child, but limited! */
44 ok1(num_allocated <= allocated_after_first);