#define GC_THREADS 1 #define GC_REDIRECT_TO_LOCAL 1 #include #include #include void *a; static void * alloc_thread (void *data) { while (1) a = GC_MALLOC_ATOMIC (123); return NULL; } static void * gc_thread (void *data) { while (1) GC_gcollect (); return NULL; } int main (int argc, char *argv[]) { pthread_t alloc, gc; GC_INIT (); pthread_create (&alloc, NULL, alloc_thread, NULL); pthread_create (&gc, NULL, gc_thread, NULL); while (1); return EXIT_SUCCESS; }