[m-rev.] for review: Use consistent integer types for some RTTI fields.

Peter Wang novalazy at gmail.com
Mon Nov 19 15:54:37 AEDT 2018


On Mon, 19 Nov 2018 14:56:46 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> 
> On Mon, 19 Nov 2018 14:37:00 +1100, Peter Wang <novalazy at gmail.com> wrote:
> > > Changing the signedness of fields in the runtime is tricky, because
> > > you will get warnings from the C compiler, which we normally regard
> > > as errors.
> > 
> > One situation: we change a field from signed to unsigned in the runtime,
> > but the bootstrap compiler populates the field with a *negative* value.
> 
> That is the potential problem.
> 
> > Do you have any other problems in mind?
> 
> Not *another problem*, but *another aspect* of the above problem.
> You must make sure that the bootstrap compiler fills these fields
> only with non-negative numbers not just on *your* machine, but on
> *everyone else's machine. It is this waiting for everyone else to install
> a new bootstrap compiler that I called "tricky".

(Personally I always install the compiler from the pregenerated sources.
I only mention this in passing so you know: once the srcdist is made,
and automatically tested, you don't need to wait on me before continuing
with your changes that required the update.)

> > That represents functor arities, not functor numbers.
> 
> I am almost certainly the one who wrote the old code here, and yet I did not
> recognize that. This tells me even more strongly that introducing two new types,
> named something like functor_arity (uint16) and functor_ordinal (uint32),
> either as type synonyms or as notag types, would be a good idea.

Sure.

> > > We should do steps 2 and 3 above for the maximum arity
> > > of a function symbol as well, though I don't think anyone will argue
> > > for allowing arities that don't fit in 16 bits. For predicates, the maximum
> > > arity we allow is either 1023 or 1024 (I don't recall which), and we should
> > > probably use the same number here.
> > 
> > Seems fine.
> 
> Absent an objection from anyone else, will you update the reference manual,
> or should I?

You can do it. I'm not sure if the maximum arity should include the
extra args.

Peter


More information about the reviews mailing list