5 #include "../smalloc.h"
7 #include "../arch/arch.h"
10 #define MAGIC1 0xa9b1c8d2
11 #define MAGIC2 0xf0a1e9b3
17 struct flist_head list;
21 static FLIST_HEAD(list);
23 static int do_rand_allocs(void)
25 unsigned int size, nr, rounds = 0;
29 while (rounds++ < LOOPS) {
34 while (total < 120*1024*1024UL) {
35 size = 8 * sizeof(struct elem) + (int) (999.0 * (rand() / (RAND_MAX + 1.0)));
38 printf("fail at %lu, size %u\n", total, size);
44 flist_add_tail(&e->list, &list);
48 printf("Got items: %u\n", nr);
50 while (!flist_empty(&list)) {
51 e = flist_entry(list.next, struct elem, list);
52 assert(e->magic1 == MAGIC1);
53 assert(e->magic2 == MAGIC2);
62 int main(int argc, char *argv[])