[m-dev.] diff: MLDS back-end: don't allocate LLDS stacks

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 18 14:09:57 AEST 2000


Estimated hours taken: 0.75

Avoid allocating the main LLDS engine data structures
(e.g. the det stack and nondet stack) for the MLDS back-end.
This is important because those data structures are large,
and get scanned by the conservative collector.

runtime/mercury_wrapper.c:
	Wrap the calls to init_thread() or save_context()
	inside `#ifndef MR_HIGHLEVEL_CODE', so that they
	are only executed for LLDS grades, not for MLDS grades.

Workspace: /home/pgrad/fjh/ws/hg
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.60
diff -u -d -r1.60 mercury_wrapper.c
--- runtime/mercury_wrapper.c	2000/05/08 16:11:07	1.60
+++ runtime/mercury_wrapper.c	2000/05/18 04:06:06
@@ -310,10 +310,11 @@
 
 	(*address_of_mercury_init_io)();
 
+#ifndef MR_HIGHLEVEL_CODE
 	/* start up the Mercury engine */
-#ifndef MR_THREAD_SAFE
+  #ifndef MR_THREAD_SAFE
 	init_thread(MR_use_now);
-#else
+  #else
 	{
 		int i;
 		init_thread_stuff();
@@ -322,7 +323,8 @@
 		for (i = 1 ; i < MR_num_threads ; i++)
 			create_thread(NULL);
 	}
-#endif
+  #endif /* ! MR_THREAD_SAFE */
+#endif /* ! MR_HIGHLEVEL_CODE */
 
 	/* initialize profiling */
 	if (MR_profiling) MR_prof_init();
@@ -342,7 +344,9 @@
 	/* initialize the Mercury library */
 	(*MR_library_initializer)();
 
+#ifndef MR_HIGHLEVEL_CODE
 	save_context(&(MR_ENGINE(context)));
+#endif
 
 	/*
 	** Now the real tracing starts; undo any updates to the trace state

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