Re: Allocators and memory reclamation
- From: "Alex R. Mosteo" <devnull@xxxxxxxxxxxxxx>
- Date: Mon, 28 Jan 2008 23:46:24 +0100
gpriv@xxxxxxxxx wrote:
On Jan 28, 9:53 am, Lucretia <lucret...@xxxxxxxxxxx> wrote:
On Jan 28, 1:49 pm, Maciej Sobczak <see.my.homep...@xxxxxxxxx> wrote:
"By default, the implementation might choose to have a single global
storage pool, which is used (by default) by all access types, which
might mean that storage is reclaimed automatically only upon partition
completion."
I didn't realise this either.
Luke.
I think what they mean here is as one allocates memory it will be
requested on the system level. This memory might be only released when
all objects are properly deallocated from the entire pool. However it
seems to be recommendation ("might") and is not what I see with GNAT.
I see memory footprint growing and shrinking as it runs and it is
never deallocating all dynamic objects at any time.
GNAT 2007 (at least) ships with two utility storage pools; one which is the
global one and other for local allocations that I guess is closer to the
behavior Maciej expected:
with System.Pool_Local;
declare
Pool : System.Unbounded_Reclaim_Pool;
type IA is access integer;
for IA'Storage_Pool use Pool;
begin
-- Allocate like crazy;
end; -- Storage is reclaimed here.
.
- References:
- Allocators and memory reclamation
- From: Maciej Sobczak
- Re: Allocators and memory reclamation
- From: Lucretia
- Re: Allocators and memory reclamation
- From: gpriv
- Allocators and memory reclamation
- Prev by Date: Re: Allocators and memory reclamation
- Next by Date: Re: Interfaces and private types
- Previous by thread: Re: Allocators and memory reclamation
- Next by thread: Re: Allocators and memory reclamation
- Index(es):
Relevant Pages
|