1 /* Example allocation which caused corruption. */
2 #include <ccan/antithread/alloc/alloc.c>
3 #include <ccan/antithread/alloc/bitops.c>
4 #include <ccan/antithread/alloc/tiny.c>
5 #include <ccan/tap/tap.h>
8 int main(int argc, char *argv[])
14 mem = malloc(1179648);
15 alloc_init(mem, 1179648);
16 ok1(alloc_check(mem, 1179648));
17 ok1(alloc_get(mem, 1179648, 48, 16));
18 ok1(alloc_check(mem, 1179648));
19 ok1(alloc_get(mem, 1179648, 53, 16));
20 ok1(alloc_check(mem, 1179648));
21 ok1(alloc_get(mem, 1179648, 53, 16));
22 ok1(alloc_check(mem, 1179648));