[m-dev.] for review: deep profiling changes [part 2/3]

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 10 20:21:52 AEDT 2000


On 10-Mar-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 10-Mar-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > --- compiler/stack_layout.m	2000/01/14 01:10:43	1.43
> > > +++ compiler/stack_layout.m	2000/02/25 23:39:36
> > > @@ -46,6 +46,7 @@
> > >  %	predicate name		(String)
> > >  %	predicate arity		(int_least16_t)
> > >  %	procedure number	(int_least16_t)
> > > +%	owner scc id		(Word) actually MR_SCCId *
> > >  %
> > >  % Automatically generated unification, index and comparison predicates
> > >  % use the second form:
> > > @@ -56,6 +57,7 @@
> > >  %	predicate name		(String)
> > >  %	predicate arity		(int_least16_t)
> > >  %	procedure number	(int_least16_t)
> > > +%	owner scc id		(Word) actually MR_SCCId *
> > 
> > Using an integer type to hold a pointer in something that
> > will be statically initialized is not portable.
> > If you do need to use some generic type, you should use a
> > pointer type such as `void *' or `Word *'.
> 
> In this case, what Tom did is right, because the data is declared and
> initialized using one C type (automatically generated from the values)
> and referred to by the runtime system using another C type.

Oh, I see now.  In that case the code will work; but the above
comments are still a bit misleading.  They should say

	%	owner scc id		(Word *) actually MR_SCCId *

since the type that the automatically-generated initialization code
will declare the field with is `Word *', or maybe `const Word *',
not `Word'.

(At least I assume that is what it will use.  If not, then the
automatically-generated code would suffer from the portability
problem that I referred to.)

-- 
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