comp.lang.ada
 help / color / mirror / Atom feed
From: anon@att.net
Subject: Re: Ada.Storage_IO. Anyone use it?
Date: Sat, 9 Jun 2012 14:24:24 +0000 (UTC)
Date: 2012-06-09T14:24:24+00:00	[thread overview]
Message-ID: <jqvman$ogo$1@speranza.aioe.org> (raw)
In-Reply-To: a09e06d1-716f-4e3b-926b-55144f20d35a@googlegroups.com

Most Storage pools are designed to use a fix size Memory block which also 
help in decreasing memory leaks. The advance is memory access allocation 
speed with garbage collection. The disadvantage is pools can be shared 
between many different data types limiting uses to storage only.

The Storage_IO can be used for "Memory Caches" for virtual storage or 
Indexed memory files such as creating an ISAM type file. In both cases, 
using Storage_IO with Direct_IO is more efficiency than pools.

For a design using both Storage_IO and Storage_Pools could be:

        Direct_IO  --  external virtual storage (multiple caches)
                Storage_IO   --  internal cache (multiple pools)
                        Storage_Pools   --  internal Memory Pool
                                Routine  --  using "new" and "free"


In <a09e06d1-716f-4e3b-926b-55144f20d35a@googlegroups.com>, Micronian Coder <micronian2@gmail.com> writes:
>Hi,
>
>I was looking through the Ada RM and came across the generic package Ada.St=
>orage_IO. I'm not sure what the benefits are to using it. It states that it=
> could automatically flatten out the data representation if necessary. For =
>example, say a discriminant record has an array field that is sized based o=
>n the discriminant value:
>
>type Buffer(Length : Positive) is
>    record
>       Bytes: Byte_Array(1 .. Length);
>    end record;
>
>The implementation chosen by the compiler could have Bytes dynamically allo=
>cated rather than embedded (I believe Randy said the Janus/Ada compiler wou=
>ld always have the arrays of this type of record dynamically allocated). Us=
>ing Ada.Storage_IO would store all the data into a buffer as if it was all =
>together and when read back it could recreate the multi-part representation=
>..
>
>Did anyone find this package useful in practice rather than define their ow=
>n IO routines (e.g. define stream operations to read and write their data)?=
> I'm really curious.
>
>Thanks!
>
>--Weston




  parent reply	other threads:[~2012-06-09 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a09e06d1-716f-4e3b-926b-55144f20d35a@googlegroups.com>
2012-06-09  8:36 ` Ada.Storage_IO. Anyone use it? Dmitry A. Kazakov
2012-06-09 14:09   ` Georg Bauhaus
2012-06-09 14:24 ` anon [this message]
2012-06-09  8:18 Micronian Coder
replies disabled

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