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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81633e7277ffacee X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada containers and custom allocators Date: Wed, 09 Jan 2008 10:29:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <472f2c87-1238-42a5-8b94-92e9b70981da@f47g2000hsd.googlegroups.com> <1rny29vw3pipd$.oppchvpo4gnf$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1199892590 12153 192.74.137.71 (9 Jan 2008 15:29:50 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 9 Jan 2008 15:29:50 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:xsB9J8cjDdXr82I/Ct78GhFkySw= Xref: g2news1.google.com comp.lang.ada:19292 Date: 2008-01-09T10:29:46-05:00 List-Id: "Dmitry A. Kazakov" writes: > On Tue, 8 Jan 2008 17:54:44 -0600, Randy Brukardt wrote: > >> But it isn't valuable enough to force every user >> of a container to define a storage pool (since there is no name for a >> standard storage pool). > > That always wondered me, why there is no name for. Especially because the > default storage pool can be obtained anyway: > > type Some_Ptr is access Integer; -- Goes to the default storage pool > package Foo is new Boo (Some_Ptr'Storage_Pool); The compiler is not required to use the same storage pool for all types. Therefore, the concept "THE default pool" does not exist. Some_Ptr'Storage_Pool might be a special pool tuned for the fact that Size_In_Storage_Elements = 4 and Alignment = 4. Allocate could add 4 to a known-aligned pointer, and ignore the Size_In_Storage_Elements and Alignment parameters. If Boo uses this pool for something other than Integer, it might not work. However, I see nothing wrong with having a predefined operation that returns a suitable pool. - Bob