libjava gcc-3_0-branch, klass timing out in testsuite again
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Sun May 6 06:41:00 GMT 2001
Fergus Henderson wrote:
> If you're going to be making assumptions about how vtables are layed out,
> then I think it's safe to also assume that `char *' and `void *' have
> the same representation, in which case you can write that a little more
> readably using type `char *' for the vtable_ptr:
>> union Self {
> char *vtable_ptr;
> typeof(*this) self;
> };
> ((Self *)this)->vtable_ptr -= 2 * sizeof (void *);
>> However, this is a matter of taste. You may prefer the other way.
>> You may also prefer hard-coding the class name instead of using
> `typeof(*this)', especially since typeof is only supported in GNU C,
> not GNU C++, I think. As you can see I haven't tested this code ;-)
Thanks for tracking this down Jeff (and thanks Fergus for suggesting the fix). I'm
checking this patch in to the trunk and branch. I've verified that it doesn't cause
any regressions on i686-pc-linux-gnu, but I don't know if it actually fixes the
original problem as I have not seen it. Could someone check? In any case, its a
damn good cleanup.
regards
[ bryce ]
More information about the Java
mailing list