Re: Freeing memory - will it be available immediately
- From: Jack Klein <jackklein@xxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 21:53:43 -0600
On Tue, 26 Feb 2008 08:44:13 +0530, santosh <santosh.k83@xxxxxxxxx>
wrote in comp.lang.c:
Ian Collins wrote:
Richard Heathfield wrote:
Ian Collins said:It may be a reasonable interpretation, but it isn't definitive. So
Kelsey Bjarnason wrote:
On Mon, 25 Feb 2008 01:10:49 -0800, karthikbalaguru wrote:According to your interpretation of the somewhat ambiguous phrase
Hi,The proper answer is that, according to the text of the standard,
Will 'free' return the memory Immediately to the OS ?
it *cannot* return the memory to the OS; the definition of free
simply does not allow this.
"made available for further allocation".
....which is a perfectly reasonable interpretation, and one that I
would fully expect implementors to support. (Whether my expectations
are actually met in the Real World is an entirely different matter!)
Kelsey's answer can't claim to be "The proper answer", merely one
possible answer.
A literal reading of the Standard's text supports Kelsey's
interpretation, but in practise I'd expect significantly sized
deallocations to be handed back to the OS, if there was a means to do
so.
[snip]
A literal reading of the standard's text says that allocated memory
properly free'd is made available for "further allocation". It most
certainly say "further allocation by the same program". Since the
term "further allocation" is not defined or constrained by the
standard in any way, where exactly does it forbid that further
allocation from being to another executable, process, device driver,
etc.?
As already said, Kelsey's interpretation is reasonable, but by no
means either guaranteed or required by the actual wording of the
standard.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
.
- Follow-Ups:
- Re: Freeing memory - will it be available immediately
- From: Kelsey Bjarnason
- Re: Freeing memory - will it be available immediately
- References:
- Freeing memory - will it be available immediately
- From: karthikbalaguru
- Re: Freeing memory - will it be available immediately
- From: Kelsey Bjarnason
- Re: Freeing memory - will it be available immediately
- From: Ian Collins
- Re: Freeing memory - will it be available immediately
- From: Richard Heathfield
- Re: Freeing memory - will it be available immediately
- From: Ian Collins
- Re: Freeing memory - will it be available immediately
- From: santosh
- Freeing memory - will it be available immediately
- Prev by Date: Re: Freeing memory - will it be available immediately
- Next by Date: Re: Rounding a floating point number
- Previous by thread: Re: Freeing memory - will it be available immediately
- Next by thread: Re: Freeing memory - will it be available immediately
- Index(es):
Relevant Pages
|