From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64f4195e0c3a0428,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.230 with SMTP id pz6mr2860473pbc.3.1339251868738; Sat, 09 Jun 2012 07:24:28 -0700 (PDT) MIME-Version: 1.0 Path: l9ni33908pbj.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Ada.Storage_IO. Anyone use it? Date: Sat, 9 Jun 2012 14:24:24 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: anon@anon.org NNTP-Posting-Host: CHV0EGZHkDOYLEOddEotZQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Date: 2012-06-09T14:24:24+00:00 List-Id: 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 , Micronian Coder 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