[Gc] 6.6 on Mac OS X 10.3.9

Cody Pisto cody at hpcs.com
Sun Sep 18 21:24:29 PDT 2005


The attached sample seems to reliably recreate the problem for me,

just build it with gcc -o testgc testgc.c -lgc

and run it from a terminal like so:

GC_DUMP_REGULARLY=1 ./testgc

Hope that helps,

-Cody


Andrew Begel wrote:

> The output you show below looks legit to me. It looks like it's  
> getting all your threads, right?
>
> At this point, we probably have to see your program. Got a small test  
> case that someone else with a Mac can try?
>
> Andrew
>

-------------- next part --------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

#define GC_THREADS
#define GC_REDIRECT_TO_LOCAL
#include "gc.h"
#include "gc_local_alloc.h"

#define NR_THREADS 5

static void *
handle_request (void *arg)
{
    void *test;
    
    for (;;)
    {
        test = GC_malloc(4096);
        
        sleep(30);
        
        test = NULL;
        
        GC_gcollect();
    }
}


int
main (int argc, char **argv)
{
    int i;
    pthread_t threads[NR_THREADS];

    GC_INIT();
    
    /* spawn the processing threadpool */
    for (i = 1; i < NR_THREADS; i++) {
        pthread_create(&threads[i], NULL, handle_request, NULL);
    }

    handle_request(NULL);

    exit(0);
    return 0; /* not reached */
}


More information about the Gc mailing list