[m-dev.] for review: compressing RTTI using non-word creates (part 2)

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Apr 27 18:05:24 AEST 1999


On 27-Apr-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> >> +% The field containing the number of live data items is encoded by the
> >> +% formula (#Long << 8 + #Short), where #Short is the number data items whose
> >> +% descriptions fit into an MR_Short_Lval and #Long is the number of data
> >> +% items whose descriptions do not.
> > 
> > What happens if #Short > 255?
> > I think you should detect that case and handle it appropriately.
> 
> The number of distinct integers that fit into 8 bits must also fit into 8 bits.

Why are the integers guaranteed to be distinct?
What happens if for example two variables both share the same location,
doesn't that mean that the same integer representating that location
will appear twice?

If that is not the case, then I think it would be helpful to clarify the
documentation to explain why not.

> > I think it would be better to avoid duplicating the common code here,
> > and write that as
...
> The code you factored out wasn't common;

Oh, right you are.  Sorry, my mistake.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list