From owner-freebsd-hackers Sun Sep 21 16:09:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA23800 for hackers-outgoing; Sun, 21 Sep 1997 16:09:27 -0700 (PDT) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA23791 for ; Sun, 21 Sep 1997 16:09:20 -0700 (PDT) Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id AAA23834; Mon, 22 Sep 1997 00:55:06 +0200 (MET DST) Message-ID: <19970922005506.48602@bitbox.follo.net> Date: Mon, 22 Sep 1997 00:55:06 +0200 From: Eivind Eklund To: Nate Williams Cc: Eivind Eklund , phk@critter.freebsd.dk, hackers@freebsd.org Subject: Re: Bug in malloc/free (was: Memory leak in getservbyXXX?) References: <199709182202.PAA10664@hub.freebsd.org> <199709211737.TAA20833@bitbox.follo.net> <199709212247.QAA28054@rocky.mt.sri.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69e In-Reply-To: <199709212247.QAA28054@rocky.mt.sri.com>; from Nate Williams on Sun, Sep 21, 1997 at 04:47:19PM -0600 Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sun, Sep 21, 1997 at 04:47:19PM -0600, Nate Williams wrote: > Eivind Eklund writes: > > [Andrew Atrens] > > > >From what I can tell Poul your free() actually gives the memory back to the > > > OS ( at least some of the time ). > > > > If this is correct, it breaks ANSI C behaviour. > > Huh? I didn't realize ANSI mandated OS support. Can you quote chapter > and verse that says this? It doesn't. However, it has a formulation that IMHO is too restrictive - that free() 'makes the memory available for further use by the program' (from memory). Thus, an implementation of malloc()/free() that give memory back to the OS is in violation of the standard. (Not that I'm certain how a program would detect this - at least I personally would consider a program that relies on being able to re-allocate memory that it has freed buggy.) Eivind.