[m-rev.] for review: fix `mmc --make' signal bugs

Simon Taylor stayl at cs.mu.OZ.AU
Thu Nov 21 20:34:04 AEDT 2002


On 21-Nov-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> That diff looks fine, but while reviewing it I spotted a bug
> in the existing code that you were modifying:
> 
> On 21-Nov-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > +++ compiler/process_util.m	21 Nov 2002 00:46:43 -0000
> > @@ -193,7 +193,7 @@
> >  
> >  	MR_incr_hp_msg(SigintHandler,
> >  		MR_bytes_to_words(sizeof(MR_signal_action)),
> > -		MR_PROC_LABEL, ""make.util.signal_action/0"");
> > +		MR_PROC_LABEL, ""libs.process_util.signal_action/0"");
> 
> There is no guarantee that the memory allocated by MR_incr_hp_msg()
> will be sufficiently aligned to hold a value of type MR_signal_action.

How aligned does it need to be?

runtime/mercury_heap.h contains the following code in
MR_MAYBE_BOX_FOREIGN_TYPE.

	/* XXX this assumes that nothing requires */
	/* stricter alignment than MR_Float */
	MR_make_hp_float_aligned();
	MR_incr_hp(MR_LVALUE_CAST(MR_Word, (box)), size_in_words);              

Is putting a call to MR_make_hp_float_aligned() before the call
to MR_incr_hp_msg() acceptable, or should I be using some other
method to allocate the memory.

> It's probably best to address this one as a separate change,
> so for now, could you please add an XXX comment for that?

Done.

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