From: David W. <wa...@cs...> - 2002-10-08 16:52:04
|
Kostis, SOrry it took me so long to look at this.. Kostis Sagonas writes: > I am trying to understand some aspects of the assert code, and > I would appreciate some help with the following two items in > case I have understood them wrongly. > > The first one is trivial; the second is more interesting. > > 1. At some point, there is a comment line that reads: > > /* 34: (cont) Addr of next ClRefI in bucket */ > > Shouldn't 34 be 36 ? It certainly looks like it should be. The trie instruction is a word, so (assuming 32-bit machines) it must be 36. > 2. In various places, the expression "4*sizeof(Cell)" appears. > Shouldn't this be "3*sizeof(Cell)" or better yet "sizeof(PrRefData)" > throughout ? Again, it certainly looks like it. PrRefs have (according to all documentation, and the declaration of PrRef) have 3 one-word fields. And as you point out, should be of length sizeof(PrRefData). With those changes the system passes the testsuite, so I'll go ahead and commit them. Thanks for noticing this. The wrong length probably came from the conversion from Prolog-hackery to C code. This code was originally written in Prolog using Buff's. In Prolog, of course, there's no sizeof so explicit numers were used. In converting to C, a mostly literal translation was done, so that's where the explicit length numbers came in. It's possible that at one point PrRefs had 4 fileds, but more likely, it was just a mistake from way back. Thanks for pointing this out. Best, -David |