🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4056

Re: Is malloc()ed storage freed upon program termination?

#4056
From: Dan Pop
Date: Wed, 20 Sep 1995 10:59
23 lines
1426 bytes
In <811549923.10778@contech.demon.co.uk> sbehrens@contech.demon.co.uk (Soenke Behrens) writes:

>jimh@earth.execpc.com (Jim Hennessy) wrote:
>
>>Does the C standard guarantee that storage allocated by malloc() is
>>freed during program termination?  If so, where?  I can't find it.
>
>Nope, this is not guaranteed. You _have_ to free all allocated memory
>yourself. A good strategy would be to work out (before you start coding)
>who is allowed to allocate memory, and who frees it again. A tool like
>memcheck does wonders, too.

Even if you free it yourself, there is no guarantee that the memory will
be returned to the system after program termination.  As it has already
been pointed out, the standard doesn't attempt to specify what happens
_after_ program termination.

Dan
--
Dan Pop
CERN, CN Division
Email: Dan.Pop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID: <danpop.811594781@rscernix>
Path: arc1-ca.pugleaf.net!CERN.ch!rscernix!danpop
References: <43l16d$3dp@homer.alpha.net> <811549923.10778@contech.demon.co.uk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!CERN.ch!rscernix!danpop
From: Dan.Pop@mail.cern.ch (Dan Pop)
Subject: Re: Is malloc()ed storage freed upon program termination?
X-Nntp-Posting-Host: ues5.cern.ch
Message-ID: <danpop.811594781@rscernix>
Sender: news@news.cern.ch (USENET News System)
Organization: CERN European Lab for Particle Physics
X-Newsreader: NN version 6.5.0 #7 (NOV)
References: <43l16d$3dp@homer.alpha.net> <811549923.10778@contech.demon.co.uk>
Date: Wed, 20 Sep 1995 10:59:41 GMT