[m-dev.] diff: fix memory leak in semaphore.m

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Sep 15 00:16:49 AEDT 2000


On 13-Sep-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> On Wed, Sep 13, 2000 at 03:59:01PM +0200, Peter Ross wrote:
> > Hi,
> > 
> > Found the memory leak!
> > The reason why it only showed up under Windows was because linux
> > pthreads don't do any allocate any resources for a condvars and mutexs
> > so they don't need to be explicitly destroyed.
> > 
> OK, now I am really confused.
> 
> I have tested out two versions of a program using the new semaphore
> module, with a diagonistic printout of which object is being freed.  One
> is compiled with -D GC_DEBUG and the other not.
> 
> The version with GC_DEBUG defined prints out the debug message and its
> heap use stays static, the other version doesn't and its heap use keeps
> going up and up.
> 
> I have tried running GC_invoke_finalizers() explicitly, and setting
> GC_finalize_on_demand to be FALSE, neither of which helped.
> 
> Any other ideas?

Are you using multithreading? 
Are you compiling the GC with -DWIN32_THREADS?

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