On Monday 30 June 2008 14:53:17 [EMAIL PROTECTED] wrote:

> Modified:
>    branches/gsoc_pdd09/include/parrot/smallobject.h
>    branches/gsoc_pdd09/src/gc/gc_it.c
>    branches/gsoc_pdd09/src/gc/memory.c
>    branches/gsoc_pdd09/src/headers.c
>
> Log:
> [gsoc_pdd09] add a few ugly but remarkably helpful diagnostics messages
>
> --- branches/gsoc_pdd09/include/parrot/smallobject.h  (original)
> +++ branches/gsoc_pdd09/include/parrot/smallobject.h  Mon Jun 30 14:53:16
> 2008 @@ -109,6 +109,8 @@
>
>  /* Switches and modes */
>
> +#define GC_IT_DEBUG             1
> +
>  #define GC_IT_INCREMENT_MODE    1
>  #define GC_IT_BATCH_MODE        0
>  #define GC_IT_SERIAL_MODE       1
>
> Modified: branches/gsoc_pdd09/src/gc/gc_it.c
> ===========================================================================
>=== --- branches/gsoc_pdd09/src/gc/gc_it.c     (original)
> +++ branches/gsoc_pdd09/src/gc/gc_it.c        Mon Jun 30 14:53:16 2008
> @@ -152,6 +152,9 @@
>      arena_base->do_gc_mark         = Parrot_gc_it_run;
>      arena_base->finalize_gc_system = Parrot_gc_it_deinit;
>      arena_base->init_pool          = Parrot_gc_it_pool_init;
> +#ifdef GC_IT_DEBUG
> +    fprintf(stderr, "GC IT Initialized: %p\n", gc_priv_data);
> +#endif
>  }

If we could rely on variadic macros, you could define a DEBUG_GC macro which 
only does something when GC_IT_DEBUG is true and not have to pepper the 
source code with #ifdef/#endif.

I think variadic macros are C99 only though, but there's always DEBUG_GC_n, 
where n is 1 .. 5.

-- c

Reply via email to