[m-dev.] diff: move the initialisation of MR_mmc_options in MR_trace_event_external()

Erwan Jahier Erwan.Jahier at irisa.fr
Sat May 22 00:54:26 AEST 1999


Estimated hours taken: 0.1

Initialise the variable MR_mmc_options only if an interactive query request is
made; it is useless to pay the price of a call to MR_TRACE_CALL_MERCURY() for
the other kinds of requests.

trace/mercury_trace_external.c:
	Move the call to 
	MR_TRACE_CALL_MERCURY(ML_DI_init_mercury_string(&MR_mmc_options))
	from the body of MR_trace_event_external() to the cases of an 
	interactive query is made. 


Index: mercury/trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.17
diff -u -r1.17 mercury_trace_external.c
--- mercury_trace_external.c    1999/05/21 14:38:21     1.17
+++ mercury_trace_external.c    1999/05/21 14:43:58
@@ -407,7 +407,6 @@
        ** queries. We initialise it to the String "".
        */
        static String   MR_mmc_options;
-       MR_TRACE_CALL_MERCURY(ML_DI_init_mercury_string(&MR_mmc_options));
 
        /* by default, print variables from the current call */
        ancestor_level = 0;
@@ -575,6 +574,9 @@
                                                "REQUEST_INTERACTIVE_QUERY"
                                                "_NORMAL\n");
                                }
+                               MR_TRACE_CALL_MERCURY(
+                                       ML_DI_init_mercury_string(
+                                               &MR_mmc_options));
                                MR_get_list_modules_to_import(
                                        debugger_request, &modules_list_length,
                                        &modules_list);
@@ -588,6 +590,9 @@
                                        fprintf(stderr, "\nMercury runtime: "
                                                "REQUEST_INTERACTIVE_QUERY_IO\n"
);
                                }
+                               MR_TRACE_CALL_MERCURY(
+                                       ML_DI_init_mercury_string(
+                                               &MR_mmc_options));
                                MR_get_list_modules_to_import(
                                        debugger_request, &modules_list_length,
                                        &modules_list);
@@ -601,6 +606,9 @@
                                        fprintf(stderr, "\nMercury runtime: "
                                                "REQUEST_INTERACTIVE_QUERY_CC\n"
);
                                }
+                               MR_TRACE_CALL_MERCURY(
+                                       ML_DI_init_mercury_string(
+                                               &MR_mmc_options));
                                MR_get_list_modules_to_import(
                                        debugger_request, &modules_list_length,
                                        &modules_list);

-- 
R1.


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