[m-dev.] for review: shut up a warning

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jan 19 13:22:32 AEDT 2001


On 19-Jan-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 18-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > That code has a memory leak in non-conservative GC grades.
> > In non-conservative GC grades, the memory will get allocated
> > with malloc(), and never freed.  It should instead get
> > allocated on the Mercury heap, so that it will get
> > reclaimed on backtracking (or by the accurate garbage
> > collector, when that is implemented).
> > 
> > That's why the code should use MR_make_string(), as I suggested
> > earlier.
> 
> Fergus, MR_make_string doesn't do what you think it does.

?

What do you think it does, and what do you think I think it does?

> I will change the code to call MR_make_aligned_string_copy.

Using MR_make_string() is better since the memory allocated
with MR_make_string() shows up in the heap allocation profile,
whereas memory allocated with MR_make_aligned_string_copy()
doesn't.

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