Fwd: [Gc] Re: Is RTEMS supported by bdwgc now ?

刘杰 lj8175 at gmail.com
Sat Apr 9 20:19:08 PDT 2011

Hi Ivan Maidanski,

I use 'cvs -z3 -d:pserver:anonymous at bdwgc.cvs.sourceforge.net:/cvsroot/bdwgc
co -P bdwgc' to checkout your code.
And then configure it as './configure --disable-shared --disable-threads
--target=i386-rtems4.10 --host=i386-rtems4.10
--prefix=/home/rtems/bdwgc/install', after add some header files as:
Index: alloc.c
RCS file: /cvsroot/bdwgc/bdwgc/alloc.c,v
retrieving revision 1.67
diff -r1.67 alloc.c
> #if defined(RTEMS)
> # include<sys/unistd.h>
> #endif
Index: reclaim.c
RCS file: /cvsroot/bdwgc/bdwgc/reclaim.c,v
retrieving revision 1.23
diff -r1.23 reclaim.c
> #if defined(RTEMS)
> # include<sys/unistd.h>
> #endif

Now, I can get my libgc.a. I use follow to test my code:

>   int i;
>   GC_INIT();
>   for(i=0;i<10000000;++i){
>     int **p=(int **)GC_MALLOC(sizeof(int *));
>     int *q=(int *)GC_MALLOC_ATOMIC(sizeof(int));
>     assert(*p==0);
>     *p=(int *)GC_REALLOC(q,2*sizeof(int));
>     if(i%100000==0)
>      printf("Heap size=%d\n",GC_get_heap_size());
>   }
It's output has attached as screen.txt.  I am trying to test bdwgc for
RTEMS/i386 cleanly, but RTEMS doesn't support virtual memory and has it's
own  entry point as Init but not main, so I need to  modify the code in

If you are interested in or have experience in that, I want to get some
advices form you.  ^_^

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://napali.hpl.hp.com/pipermail/gc/attachments/20110410/fe89ff3a/attachment.htm

More information about the Gc mailing list