Back to index

plt-scheme  4.2.1
middle.c
Go to the documentation of this file.
00001 /*
00002  * Test at the boundary between small and large objects.
00003  * Inspired by a test case from Zoltan Varga.
00004  */
00005 #include <gc.h>
00006 #include <stdio.h>
00007 
00008 int main ()
00009 {
00010         int i;
00011 
00012         GC_all_interior_pointers = 0;
00013 
00014         for (i = 0; i < 20000; ++i) {
00015                 GC_malloc_atomic (4096);
00016                 GC_malloc (4096);
00017        }
00018         for (i = 0; i < 20000; ++i) {
00019                 GC_malloc_atomic (2048);
00020                 GC_malloc (2048);
00021        }
00022        printf("Final heap size is %ld\n", GC_get_heap_size());
00023        return 0;
00024 }
00025