Usage of refTable in gc / declaration of VALIDREF
Frank Mehnert
Frank.Mehnert at mchp.siemens.de
Mon Mar 24 01:13:27 PST 1997
Hi,
the gc of kaffe uses a refTable to index each object. In function
scanConservative each object is scanned to find any references to other
objects. The macro VALIDREF tests if a reference is valid (declared in
gc-incremental.h):
#define VALIDREF(_r) \
((_r) / REF_MAXW < REF_MAXH && \
refTable.width[(_r) / REF_MAXW] != 0)
But there is NOT a line refTable.width[0]!!! Compare function gc_malloc
for this:
refTable.nextWidth++;
assert(refTable.nextWidth < REF_MAXH);
refTable.width[refTable.nextWidth] =
checked_calloc(REF_MAXW, sizeof(uintp));
So let us change the declaration of VALIDREF into
#define VALIDREF(_r) \
(((_r)-REF_MAXH) / REF_MAXW < (REF_MAXH-1) && \
refTable.width[(_r) / REF_MAXW] != 0)
Do you agree with that?
Because of linebreaks I have uuencoded the patch:
begin 600 gc-validref.diff
M*BHJ(&=C+6EN8W)E;65N=&%L+F@)36]N($UA<B R-" P.3HT,SHU-B Q.3DW
M"BTM+2 N+B\N+B\N+B]K869F92TP+C at N,RY/4DE'+VMA9F9E+VMA9F9E=FTO
M9V,M:6YC<F5M96YT86PN: E&<FD at 36%R(#(Q(#$U.C$U.C4U(#$Y.3<**BHJ
M*BHJ*BHJ*BHJ*BHJ"BHJ*B U,2PU-R J*BHJ"B @(V1E9FEN92!-04M%4D5&
M*%]H+"!?=RD@(" @(" @(" H*"A?:"D@*B!2149?34%85RD@*R H7W<I*0H@
M("-D969I;F4 at 1T544D5&*%]R*2 @(" @(" @(" @(" @<F5F5&%B;&4N=VED
M=&A;*%]R*2 O(%)%1E]-05A775LH7W(I("4 at 4D5&7TU!6%=="B @(V1E9FEN
M92!31512148H7W(L(%]V*2 @(" @(" @("!R969486)L92YW:61T:%LH7W(I
M("\@4D5&7TU!6%==6RA?<BD@)2!2149?34%85UT@/2 H:G=O<F0I*%]V*0HA
M("-D969I;F4 at 5D%,2412148H7W(I(" @(" @(" @(" @*"@H7W(I+5)%1E]-
M05A(*2 O(%)%1E]-05A7(#P@*%)%1E]-05A(+3$I("8F(')E9E1A8FQE+G=I
M9'1H6RA?<BD at +R!2149?34%85UT@(3T@,"D*(" *(" C9&5F:6YE($U%33)'
M0RA?;2D@(" @(" @(" @(" @("@H9V-);F9O*BDH*"AU:6YT."HI*%]M*2D@
M+2!S:7IE;V8H9V-);F9O*2DI"B @(V1E9FEN92!'0S)-14TH7V<I(" @(" @
M(" @(" @(" H*'9O:60J*2 at H7V<I*S$I*0HM+2T at -3$L-3<@+2TM+0H@("-D
M969I;F4 at 34%+15)%1BA?:"P at 7W<I(" @(" @(" @*"@H7V at I("H at 4D5&7TU!
M6%<I("L@*%]W*2D*(" C9&5F:6YE($=%5%)%1BA?<BD@(" @(" @(" @(" @
M(')E9E1A8FQE+G=I9'1H6RA?<BD at +R!2149?34%85UU;*%]R*2 E(%)%1E]-
M05A770H@("-D969I;F4 at 4T544D5&*%]R+"!?=BD@(" @(" @(" @<F5F5&%B
M;&4N=VED=&A;*%]R*2 O(%)%1E]-05A775LH7W(I("4 at 4D5&7TU!6%==(#T@
M*&IW;W)D*2A?=BD*(2 C9&5F:6YE(%9!3$E$4D5&*%]R*2 @(" @(" @(" @
M("@H7W(I("\@4D5&7TU!6%<@/"!2149?34%82" F)B!R969486)L92YW:61T
M:%LH7W(I("\@4D5&7TU!6%==("$](# I"B @"B @(V1E9FEN92!-14TR1T,H
M7VTI(" @(" @(" @(" @(" H*&=C26YF;RHI*"@H=6EN=#@J*2A?;2DI("T@
M<VEZ96]F*&=C26YF;RDI*0H@("-D969I;F4 at 1T,R345-*%]G*2 @(" @(" @
8(" @(" @*"AV;VED*BDH*%]G*2LQ*2D*
end
Frank
Frank Mehnert
email: Frank.Mehnert at mchp.siemens.de
More information about the kaffe
mailing list