This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Java GC descriptor vs. tree_int_cst on 64-bit platforms


Thanks.  The ", or" should be deleted.

This is a bit confusing because MIN_WORDS applies to the actual size of the
allocated object, and the condition at the end refers to the requested
object size.  GC_gcj_malloc doesn't really work for 1 word objects
(unfortunately for very subtle reasons).  Setting MIN_WORDS to 2 causes the
size of small objects to be rounded up suitably.  I'd be happy with a more
substantial restatement of the comment as well.

(The code here comes from the GC 6.0alpha distribution, which introduces a
second case for which MIN_WORDS = 2 is required.  But that's not possible
here, and hence the second clause was deleted from the comment.  This part
of the patch is not strictly necessary for the 3.0 branch, since all objects
allocated through GC_gcj_malloc in 3.0 have a 2 word header.  But both this
and the finalization patch will make the 3.0 GC interface more robust and
more consistent with later versions.)

There are clearly too many different versions of this garbage collector
around at the moment.  I would personally like to move to a model where the
version in the gcc tree is the one and only "official" one, though seriously
experimental versions may still apear elsewhere first.  That's not yet
possible for several reasons (incompatible build processes; before 6.0 there
were too many essential compile-time options; 6.0 isn't quite ready, and
hasn't yet made it into the gcc trunk.)  But all of those are fixable, and
on my list of things to fix.

Hans

> -----Original Message-----
> From: Fergus Henderson [mailto:fjh@cs.mu.oz.au]
> Sent: Wednesday, March 28, 2001 6:23 PM
> To: Boehm, Hans
> Cc: 'aph@cambridge.redhat.com'; 'java@gcc.gnu.org'; 'gcc@gcc.gnu.org'
> Subject: Re: Java GC descriptor vs. tree_int_cst on 64-bit platforms
> 
> 
> On 28-Mar-2001, Boehm, Hans <hans_boehm@hp.com> wrote:
> > +++ gc_priv.h	2001/03/15 22:38:53
> > @@ -890,6 +890,18 @@
> >  #   define SMALL_OBJ(bytes) ((bytes) <= WORDS_TO_BYTES(MAXOBJSZ))
> >  #   define ADD_SLOP(bytes) (bytes)
> >  # endif
> > +# ifndef MIN_WORDS
> > +    /* MIN_WORDS is the size of the smallest allocated 
> object.	*/
> > +    /* 1 and 2 are the only valid values.			*/
> > +    /* 2 must be used if:					*/
> > +    /* - GC_gcj_malloc can be used for objects of size 	
> 	*/
> > +    /*   smaller than 2 words, or				*/
> > +#   if defined(GC_GCJ_SUPPORT)
> > +#     define MIN_WORDS 2   	/* Smallest allocated 
> object.	*/
> > +#   else
> > +#     define MIN_WORDS 1
> > +#   endif
> > +# endif
> 
> The comment there is incomplete (ends in ", or") and seems 
> contradictory
> (*MIN*_WORDS is 2 if GC_gcj_malloc can be used for objects of 
> size *smaller*
> than 2 words?).
> 
> -- 
> Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known 
> that the pursuit
>                                     |  of excellence is a 
> lethal habit"
> WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words 
> of T. S. Garp.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]