OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [boehm-gc/] [testsuite/] [boehm-gc.lib/] [staticrootslib.c] - Blame information for rev 849

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 721 jeremybenn
#include <stdio.h>
2
 
3
#ifndef GC_DEBUG
4
# define GC_DEBUG
5
#endif
6
 
7
#include "gc.h"
8
 
9
struct treenode {
10
    struct treenode *x;
11
    struct treenode *y;
12
} * root[10];
13
 
14
struct 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
 
24
void * libsrl_init(void)
25
{
26
  GC_INIT();
27
  return GC_MALLOC(sizeof(struct treenode));
28
}
29
 
30
void * libsrl_collect (void)
31
{
32
  GC_gcollect();
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.