5 #include "../smalloc.h"
9 struct timeval *fio_tv = NULL;
10 unsigned int fio_debug = 0;
12 #define MAGIC1 0xa9b1c8d2
13 #define MAGIC2 0xf0a1e9b3
19 struct flist_head list;
25 static int do_rand_allocs(void)
27 unsigned int size, nr, rounds = 0;
31 while (rounds++ < LOOPS) {
36 while (total < 128*1024*1024UL) {
37 size = 8 * sizeof(struct elem) + (int) (999.0 * (rand() / (RAND_MAX + 1.0)));
40 printf("fail at %lu, size %u\n", total, size);
46 flist_add_tail(&e->list, &list);
50 printf("Got items: %u\n", nr);
52 while (!flist_empty(&list)) {
53 e = flist_entry(list.next, struct elem, list);
54 assert(e->magic1 == MAGIC1);
55 assert(e->magic2 == MAGIC2);
64 static int do_specific_alloc(unsigned long size)
73 int main(int argc, char *argv[])
81 /* smalloc bug, commit 271067a6 */
82 do_specific_alloc(671386584);
88 void __dprint(int type, const char *str, ...)