[m-rev.] for review: reducing the size of type ctor info structures, part 1

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Dec 31 15:25:19 AEDT 2001


On 31-Dec-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Hmm...
> Why does the "New" version of this struct have unused fields?

Because the unused fields cannot be reused for other purposes until the version
number moves out of the way. That will be for a later change, after part 2.

> > +#define	MR_type_ctor_rep(type_ctor_info)			\
> > +		((MR_TypeCtorRep) ((const struct MR_NewTypeCtorInfo_Struct *) \
> > +			(type_ctor_info))->MR_type_ctor_old_rep_CAST_ME)
> 
> Please use MR_CHECK_EXPR_TYPE to check the type of the argument.

I can't, because it is OK for the argument to have either of two types,
MR_OldTypeCtorInfo_Struct and MR_NewTypeCtorInfo_Struct. In any case,
all uses of the macro are currently type-safe, and once part 2 is installed,
the macro will be deleted, its uses reverting to direct field references,
only now referring to the repositioned field.

> ...
> > +#define MR_DECLARE_STRUCT(T)                                        \
> > +    extern MR_STATIC_CODE_CONST struct T##_struct T
> 
> I don't think it's right to use MR_STATIC_CODE_CONST there.
> That would only be appropriate for structs which contain
> code addresses, not for structs in general.
> 
> What is MR_DECLARE_STRUCT() used for?
> If it's not used, maybe it can just be deleted.

It is not used, so I deleted it.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list