5 #include <AD/memory/arena.h> // Arenas
6 #include <AD/memory/boundtag.h> // Boundary tag memory manager
7 #include <AD/memory/buddy.h> // Fibonacci buddy system
8 #include <AD/memory/mempool.h> // Memory pool
9 #include <AD/memory/strpool.h> // String pool
11 int main(int argc
, char * argv
[])
13 StringPool A
; MemPool B
;
23 for (i
= 0; i
< 257; i
++)
24 { core
[i
] = C
[i
]; memset(core
[i
],255,i
);
28 BoundaryTag::Statistics S
= C
.statistics();
29 printf("pages = %d\n", S
.page_count
);
30 printf("bytes allocated = %d\n", S
.bytes_allocated
);
31 printf("bytes available = %d\n", S
.bytes_available
);
32 printf("free blocks = %d\n", S
.free_block_count
);
43 printf("pages = %d\n", S
.page_count
);
44 printf("bytes allocated = %d\n", S
.bytes_allocated
);
45 printf("bytes available = %d\n", S
.bytes_available
);
46 printf("free blocks = %d\n", S
.free_block_count
);
50 // double * x = arena();
51 // double * y = arena();
53 // arena.free(x); arena.free(y);
56 Buddy
buddy(block
, sizeof(block
));
58 for (i
= 0; i
< 257; i
++)
59 { core
[i
] = buddy
[i
]; memset(core
[i
],255,i
); }