]> git.ipfire.org Git - thirdparty/gcc.git/blame - boehm-gc/testsuite/boehm-gc.lib/staticrootslib.c
re PR target/78594 (Bug in November 11th, 2016 change to rs6000.md)
[thirdparty/gcc.git] / boehm-gc / testsuite / boehm-gc.lib / staticrootslib.c
CommitLineData
be0959d2
DK
1#include <stdio.h>
2
3#ifndef GC_DEBUG
4# define GC_DEBUG
5#endif
6
7#include "gc.h"
8
9struct treenode {
10 struct treenode *x;
11 struct treenode *y;
12} * root[10];
13
14struct treenode * libsrl_mktree(int i)
15{
16 struct treenode * r = GC_MALLOC(sizeof(struct treenode));
17 if (0 == i) return 0;
18 if (1 == i) r = GC_MALLOC_ATOMIC(sizeof(struct treenode));
19 r -> x = libsrl_mktree(i-1);
20 r -> y = libsrl_mktree(i-1);
21 return r;
22}
23
24void * libsrl_init(void)
25{
26 GC_INIT();
27 return GC_MALLOC(sizeof(struct treenode));
28}
29
30void * libsrl_collect (void)
31{
32 GC_gcollect();
33}