X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-boehmgc.git;a=blobdiff_plain;f=gc-7.2%2Ftests%2Fmiddle.c;fp=gc-7.2%2Ftests%2Fmiddle.c;h=ff0a2355d1597fee9fbff6b3b6558821a4053f26;hp=0000000000000000000000000000000000000000;hb=324587ba93dc77f37406d41fd2a20d0e0d94fb1d;hpb=2a4ea609491b225a1ceb06da70396e93916f137a diff --git a/gc-7.2/tests/middle.c b/gc-7.2/tests/middle.c new file mode 100644 index 0000000..ff0a235 --- /dev/null +++ b/gc-7.2/tests/middle.c @@ -0,0 +1,25 @@ +/* + * Test at the boundary between small and large objects. + * Inspired by a test case from Zoltan Varga. + */ +#include "gc.h" +#include + +int main (void) +{ + int i; + + GC_set_all_interior_pointers(0); + GC_INIT(); + + for (i = 0; i < 20000; ++i) { + GC_malloc_atomic (4096); + GC_malloc (4096); + } + for (i = 0; i < 20000; ++i) { + GC_malloc_atomic (2048); + GC_malloc (2048); + } + printf("Final heap size is %lu\n", (unsigned long)GC_get_heap_size()); + return 0; +}