Back to index

plt-scheme  4.2.1
trace_test.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #define GC_DEBUG
00003 #include "gc.h"
00004 
00005 struct treenode {
00006     struct treenode *x;
00007     struct treenode *y;
00008 } * root[10];
00009 
00010 struct treenode * mktree(int i) {
00011   struct treenode * r = GC_MALLOC(sizeof(struct treenode));
00012   if (0 == i) return 0;
00013   if (1 == i) r = GC_MALLOC_ATOMIC(sizeof(struct treenode));
00014   r -> x = mktree(i-1);
00015   r -> y = mktree(i-1);
00016   return r;
00017 }
00018 
00019 main()
00020 {
00021   int i;
00022   for (i = 0; i < 10; ++i) {
00023     root[i] = mktree(12);
00024   }
00025   GC_generate_random_backtrace();
00026   GC_generate_random_backtrace();
00027   GC_generate_random_backtrace();
00028   GC_generate_random_backtrace();
00029 }