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

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Mar 10 18:37:41 AEDT 2000


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. As long as
he ensures that the fields are the same size, which he has, this will
work ok. The debugger already uses this approach. It would be nice
if the proc and label layouts could be generated in a more type-safe
manner, but (a) that is not part of this change, and (b) it would make
it more difficult to perform our current optimization of outputing
only the part of a proc layout that the compilation options require.

With the exception of the comments relating to this, I agree with Fergus's
review.

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