[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash table memory leak

From: Eli Zaretskii
Subject: Re: hash table memory leak
Date: 14 Mar 2004 09:06:28 +0200

> Date: Thu, 11 Mar 2004 17:52:06 -0500
> From: "Paul D. Smith" <address@hidden>
> If you mean that this memory is just not freed when make calls exit(),
> then that's fine (with me).  Make has never been written to attempt to
> free this memory.
> But these are _not_ leaks.


>   jg> Many OS have poor memory management, Microsoft win9x is one OS
>   jg> which often looses memory allocated to processes which do not
>   jg> release before terminating.  I am sure there are many other OS
>   jg> which will not recover the memory.
> Not really.  GNU make only supports DOS/Windows, OS/2, Amiga, UNIX-ish,
> and VMS.  Of those, I know for a fact that all the UNIX and VMS systems
> behave properly, and I'm quite sure Amiga and OS/2 do as well.  And, as
> much as I like to abuse them the newer Windows versions almost certainly
> work properly here.  DOS and Windows 9x might not be so pleasant I
> suppose.

The DOS (a.k.a. DJGPP) port of GNU make is built with a runtime
library that takes care of releasing all memory allocated by the
program when that program exits.  On DOS, this works perfectly, to the
best of my knowledge (meaning that I've never seen any report to the
contrary in the past 10 years).  On Windows, we know about several
bugs in the Windows DPMI server[1] that cause it to lose resources,
such as segment descriptors, but those are irrelevant to the heap
memory, so freeing malloc'ed memory before exiting will not cure them.
(The DJGPP runtime in its last released version goes to great lengths
to work around those bugs, so that for a DJGPP program they are all
but nonexistent.)

In other words, the DOS port of GNU Make doesn't suffer from the
problems discussed in this thread.

[1] DPMI, the DOS Protected Mode Interface, is an API that allows DOS
programs to run in 32-bit protected mode even though the underlying OS
is a 16-bit real-mode one.  DJGPP runtime uses DPMI services to gain
access to the full 32-bit address space of the x86 machine it runs on,
and to run protected-mode code on top of real-mode OS.  MS-Windows
includes a built-in (and buggy) DPMI server as part of the OS.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]