[Gc] small bugs

Boehm, Hans hans.boehm at hp.com
Tue Aug 26 16:53:00 PDT 2008


Thanks.   Some comments below:

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Marco Maggi
> Sent: Monday, August 25, 2008 11:08 PM
> To: gc
> Subject: [Gc] small bugs
>
> Ciao,
>
> I am using GC 7.1 released tarball.
>
> * In "gc.h" the definitions:
>
> | #   define GC_PRE_INCR3(x, n, type_of_result) \
> |          ((type_of_result)GC_pre_incr(&(x), (n)*sizeof(*x))
> | #   define GC_POST_INCR2(x, type_of_result) \
> |          ((type_of_result)GC_post_incr(&(x), sizeof(*x))
>
> lack the ending ")".
>
> * In "gc.h" the definitions:
>
> | #ifdef GC_DEBUG
> | #   define GC_POST_INCR2(x, type_of_result) \
> |       ((type_of_result)GC_post_incr(&(x), sizeof(*x)))
> | #   ifdef __GNUC__
> | #       define GC_POST_INCR(x, n) \
> |           GC_POST_INCR3(x, typeof(x))
> | #   endif
> | #else /* !GC_DEBUG */
> | #   define GC_POST_INCR2(x, n, type_of_result) ((x)++)
> | #   define GC_POST_INCR(x, n) ((x)++)
> | #endif
>
> are  not correct: both  GC_POST_INCR2 and  GC_POST_INCR3 are
> mentioned; GC_POST_INCR makes no use of "n".
>
> I would do:
>
> | #ifdef GC_DEBUG
> | #   define GC_POST_INCR3(x, n, type_of_result) \
> |       ((type_of_result)GC_post_incr(&(x), (n)*sizeof(*x)))
> | #   ifdef __GNUC__
> | #       define GC_POST_INCR(x, n) \
> |           GC_POST_INCR3(x, n, typeof(x))
> | #   endif
> | #else /* !GC_DEBUG */
> | #   define GC_POST_INCR3(x, n, type_of_result) \
> |        ((x) += (n), (x) - (n))
> | #   define GC_POST_INCR(x, n) ((x) += (n), (x) - (n))
> | #endif
>
> By the  way, IMHO "type_of_result" should be  used even when
> "GC_DEBUG" is undefined.
As you discovered,this stuff has clearly not received much (any?) use.  I decided to make a quick attempt at fixing it, rather than throwing it out, which I think is also a serious option.  I checked the result into the CVS tree.  It's somewhat different from what you suggested.  I also now included some extremely minila tests, to make sure the stuff at least compiles.

>
> * In "gc.h":
>
> | void * GC_malloc_many(size_t lb);
>
> and  some other  functions are  missing a  GC_API qualifier,
> does this mean that they are not for public use?
This was a bug that was already recently pointed out by someone else.  (On most platforms GC_API doesn't really matter.)  I was fixed in the CVS tree a little while ago.

>
> * The  tutorial  on the  web  mentions a  "gc_local_alloc.h"
>   header file  that I  do not see  in GC  7.1 (I only  see a
>   "include/private/thread_local_alloc.h").
>
> * The tutorial  on the web  mentions a "--enable-full_debug"
>   configuration option,  but I see  only "--enable-gc-debug"
>   in the output of "configure --help".
I attempted to fix those in the doc directory in CVS.

>
> --
> Marco Maggi
>
> "Now feel the funk blast!"
> Rage Against the Machine - "Calm like a bomb"
>
>
>
> _______________________________________________
> 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