[m-dev.] for review: fix memory leak

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 6 06:22:24 AEST 1999


On 05-Oct-1999, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Fergus Henderson writes:
> > 
> > Estimated hours taken: 16
> > 
> > Fix a problem where the compiler was leaking memory
> > when compiling more than one file a time.
> > Note that this fix solves that specific bug,
> > but does not address the problem in general.
> 
> If you are going to mention that there is a general problem,
> could you give some more details on what the general problem is?

	Note that this fix solves that specific bug,
	but does not address the problem in general,
      | which is that the conservative garbage collector
      | is scanning the whole of the Mercury stacks.
	(A more general fix would be for the garbage collector
	scan only the parts of the Mercury stacks which
	are currently live, but this is trickier...)

> > The fix includes adding a new library module library/gc.m.
> 
> The new module should be mentioned in NEWS.

Done.  See diff below.

> > diff -N gc.m
> 
> > +% This module defines some procedures for controlling the actions
> > +% of the garbage collector.
> > +%
> > +% ---------------------------------------------------------------------------%
> > +% ---------------------------------------------------------------------------%
> 
> Just a quibble, but I think
> s/% --/%---/

Oops, that was quite accidental.  Fixed.

> > +** MR_clear_zone_for_GC(MemoryZone *zone, void *start_address):
> > +**	Zero out the (hopefully unused) portion of the zone
> > +**	from the specified `start_address' to the end of the zone.
> > +**	This is used to avoid unwanted memory retition due to 
> 
> retition?

s/retition/retention/g


I'll go ahead and commit this now.

----------

NEWS:
	Mention the new `gc' library module.

Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.146
diff -u -u -r1.146 NEWS
--- NEWS	1999/09/16 04:01:26	1.146
+++ NEWS	1999/10/05 20:17:37
@@ -55,6 +55,12 @@
   However, many of the operations in the standard library still handle
   errors by aborting execution rather than by throwing exceptions.
 
+* There's a new standard library module `gc', for controlling the
+  garbage collector.
+
+  Currently it contains only one predicate, `garbage_collect',
+  which forces a garbage collection.  We may add more later.
+
 * We've added some new predicates to the Mercury standard library:
 	array__map/3,
 	bag__count_value/3.


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