comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen)
Subject: Re: How do I free unbounded strings?
Date: 6 Mar 2001 09:10:59 -0500
Date: 2001-03-06T09:10:59-05:00	[thread overview]
Message-ID: <+2AUoSXZYRsx@eisner.encompasserve.org> (raw)
In-Reply-To: 3AA3DEC1.24B781CA@home.com

In article <3AA3DEC1.24B781CA@home.com>, Mark Biggar <mark.a.biggar@home.com> writes:
> Erik Sigra wrote:
>>   For unbounded strings the ":=" operation does the necessary storage
>>   management through Adjust and Finalize operations to allocate needed space
>>   for the new value of the target and to reclaim the space previously
>>   occupied by the object.
>> ...example program deleted. 
>> So it appears to me as if freeing doesn't work as the rationale says. Could
>> someone please help me with this?
> 
> Sure, first you must understand that there is a difference between
> freeing memory for a data structure in a program and a program
> actually giving back memory to the operating system.  On most operating
> systems when a program needs more memory it asks the Opsys for a large
> block and then allocated chunks of that block to various dymanmic
> data stuctures (like Unbounded_String), but when the program frees
> one of those data structures, it is only part fo the large block
> and so is not given back to the Opsys, it just becomes available
> to be allocated for some other data structure in that program.

While such a caching strategy can provide significant performance
benefits, there are situations where it is done by the "operating
system".  In VMS that is the LIB$*_VM runtime library calls, which
are delivered as part of the operating system although they are not
part of the kernel.

The same precautions you mention about measuring free memory still
apply.  Few programs bypass the LIB$*_VM runtime library calls.



      reply	other threads:[~2001-03-06 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-05 17:03 How do I free unbounded strings? Erik Sigra
2001-03-05 20:14 ` Florian Weimer
2001-03-05 21:10   ` Erik Sigra
2001-03-06  1:49     ` Robert A Duff
2001-03-05 20:48 ` Jeffrey Carter
2001-03-05 20:55   ` Erik Sigra
2001-03-06  2:52 ` Mark Biggar
2001-03-06 14:10   ` Larry Kilgallen [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox