[Gc] (more) Problems on mac

Hans Boehm Hans.Boehm at hp.com
Mon Jul 11 22:12:16 PDT 2005


It sounds like something is still seriously wrong here.  Does it also
grow with smaller objects (say 1K)?

If so, the next step would be to look at GC_PRINT_STATS and
GC_DUMP_REGULARLY output.

I'm still trying to find some time to get another gc7 release out.  There
are some pending patches.

Hans

On Wed, 6 Jul 2005, Stephane Epardaud wrote:

> Hello,
>
> I'm still trying to compile the GC7.a3 under MacOSX with pthread support.
> After much problems with push_regs, getcontext and all, I came to the conclusion
> that (as indicated by the #error macro in mach_dep.c) I needed to have
> HAVE_ASM_PUSH_REGS undef'ed if THREADS and DARWIN were defined.
> This made sure we were not using GC_push_regs, but then since UNIX_LIKE was
> defined, in GC_with_callee_saves_pushed (mach_dep.c) I got the getcontext()
> call, which is not implemented/defined in MacOSX, on the other hand,
> HAVE_BUILTIN_UNWIND_INIT was, so I managed to get that one.
> Now I have all that, and if I try this simple program:
>
> #include <gc.h>
> #include <stdio.h>
>
>
> int main(int argc, char **argv){
>   GC_init();
>   while(1){
>     printf("mallocing\n");
>     GC_malloc(1024*1024);
>   }
>   return 0;
> }
>
> The size of my program running keeps on growing. This is only if configured with
> --enable-threads=pthreads, if not then the program's memory consumption doesn't
> grow. Is this normal ?
>
> PS: to understand the changes I'm talking about, here's my mach_dep.c patch. If
> I manage to get the GC to run correctly on MacOSX, I'll send more patches that I
> needed to make it compile.
>
> varuna separdau 16:50 ~/src $ diff -wu gc7.0alpha3-mint/mach_dep.c
> gc7.0alpha3-nolurc/mach_dep.c
> --- gc7.0alpha3-mint/mach_dep.c 2005-02-24 02:13:08.000000000 +0100
> +++ gc7.0alpha3-nolurc/mach_dep.c       2005-07-06 15:31:27.183086304 +0200
> @@ -75,6 +75,10 @@
>
>  #undef HAVE_PUSH_REGS
>
> +#if defined(DARWIN) && defined(THREADS)
> +# undef USE_ASM_PUSH_REGS
> +#endif
> +
>  #if defined(USE_ASM_PUSH_REGS)
>  #  define HAVE_PUSH_REGS
>  #else  /* No asm implementation */
> @@ -210,7 +214,7 @@
>
>  #   if defined(HAVE_PUSH_REGS)
>        GC_push_regs();
> -#   elif defined(UNIX_LIKE)
> +#   elif defined(UNIX_LIKE) && !defined(DARWIN)
>        ucontext_t ctxt;
>        getcontext(&ctxt);
>        context = &ctxt;
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>


More information about the Gc mailing list