[m-rev.] diff: grade `hlc': save/restore hp in MR_do_interpreter()

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Mar 6 14:59:33 AEDT 2002


Estimated hours taken: 0.5
Branches: main

runtime/mercury_wrapper.c:
	Save and restore the heap pointer in do_interpreter() for grade
	`hlc' (i.e. high level code and neither conservative GC or
	accurate GC), just like we do in grade `asm_fast'.  This is
	needed to run benchmarks in grade `hlc'.

Workspace: /home/ceres/fjh/mercury
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.102
diff -u -d -r1.102 mercury_wrapper.c
--- runtime/mercury_wrapper.c	24 Feb 2002 11:53:36 -0000	1.102
+++ runtime/mercury_wrapper.c	6 Mar 2002 03:56:23 -0000
@@ -1448,6 +1448,15 @@
 static void
 MR_do_interpreter(void)
 {
+  #if !defined(MR_CONSERVATIVE_GC) && !defined(MR_NATIVE_GC)
+	/*
+	** Save the heap pointer here and restore it at the end
+	** of this function, so that you can run benchmarks in
+	** a loop in grade `hlc' without running out of memory.
+	*/
+	MR_Word *saved_hp = MR_hp;
+  #endif
+	
   #ifdef  MR_MPROF_PROFILE_TIME
 	if (MR_profiling) {
 		MR_prof_turn_on_time_profiling();
@@ -1494,6 +1503,10 @@
 	if (MR_profiling)  {
 		MR_prof_turn_off_time_profiling();
 	}
+  #endif
+
+  #if !defined(CONSERVATIVE_GC) && !defined(NATIVE_GC)
+	MR_hp = saved_hp;
   #endif
 }
 

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