[m-dev.] For review: calling MR_collect_filter() in MR_trace_real()

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 6 05:47:01 AEDT 2001


On 05-Mar-2001, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> +++ trace/mercury_trace_external.c	2001/03/05 17:30:14
> @@ -135,6 +134,15 @@
>  static	void	(*send_collect_result_ptr)(MR_Word, MR_Word);
>  
>  /*
> +** Function pointer which is applied to each event during collect requests.
> +*/
> +
> +static void	(*filter_ptr)(MR_Integer, MR_Integer, MR_Integer, MR_Word,
> +			MR_Word, MR_String, MR_String, MR_String, MR_Integer,
> +			MR_Integer, MR_Word, MR_Integer, MR_String, MR_Word, 
> +			MR_Word *, MR_Char *);

I think it would be nicer to make that a field in the MR_Trace_Cmd_Info
(and passing this field to MR_COLLECT_filter(), as before),
rather than making it a static variable.

Static variables cause problems for reentrancy, which causes various
difficulties.

> @@ -1504,7 +1489,7 @@
>  			arguments = MR_list_empty()
>  		);
>  	}
> -	MR_TRACE_CALL_MERCURY((*filter_ptr)(
> +	(*filter_ptr)(
>  		MR_trace_event_number,
>  		seqno,
>  		depth,

What happened to the MR_TRACE_CALL_MERCURY() macro here?
Why did that go away?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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