diff options
| author | William Casarin <jb55@jb55.com> | 2018-07-09 22:28:25 -0700 |
|---|---|---|
| committer | William Casarin <jb55@jb55.com> | 2018-07-09 22:31:48 -0700 |
| commit | 9593fc545950782ed75f12f53238b07885559b2b (patch) | |
| tree | 9c7c2f7cbb427c54e9184cb61eedce737a6cbc6f /ccan/tal/test/run-groups-grow.c | |
| parent | bd8c223756d2f912526ecef53bae0cc8e0c63442 (diff) | |
remove ccan for now
Diffstat (limited to 'ccan/tal/test/run-groups-grow.c')
| -rw-r--r-- | ccan/tal/test/run-groups-grow.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/ccan/tal/test/run-groups-grow.c b/ccan/tal/test/run-groups-grow.c deleted file mode 100644 index ea379c0..0000000 --- a/ccan/tal/test/run-groups-grow.c +++ /dev/null @@ -1,48 +0,0 @@ -#define CCAN_TAL_DEBUG -#include <ccan/tal/tal.h> -#include <ccan/tal/tal.c> -#include <ccan/tap/tap.h> - -static size_t num_allocated; - -static void *alloc_account(size_t len) -{ - num_allocated++; - return malloc(len); -} - -static void free_account(void *p) -{ - num_allocated--; - return free(p); -} - -#define NUM_ALLOCS 1000 - -int main(void) -{ - void *p, *c[NUM_ALLOCS]; - int i; - size_t allocated_after_first; - - plan_tests(1); - - tal_set_backend(alloc_account, NULL, free_account, NULL); - - p = tal(NULL, char); - c[0] = tal(p, char); - - allocated_after_first = num_allocated; - for (i = 1; i < NUM_ALLOCS; i++) - c[i] = tal(p, char); - - /* Now free them all. */ - for (i = 0; i < NUM_ALLOCS; i++) - tal_free(c[i]); - - /* We can expect some residue from having any child, but limited! */ - ok1(num_allocated <= allocated_after_first); - tal_free(p); - tal_cleanup(); - return exit_status(); -} |
