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,e447f17ef3e0aaf3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.18.144 with SMTP id w16mr2804094qaa.1.1343577870186; Sun, 29 Jul 2012 09:04:30 -0700 (PDT) Path: a15ni155884582qag.0!nntp.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Emulating placement new Date: Sun, 29 Jul 2012 12:04:29 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <87vch67jsk.fsf@mid.deneb.enyo.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1343577869 4205 192.74.137.71 (29 Jul 2012 16:04:29 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 29 Jul 2012 16:04:29 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:SmwctPNOhRf/KwUAbXSyRuxCf4U= Content-Type: text/plain; charset=us-ascii Date: 2012-07-29T12:04:29-04:00 List-Id: Florian Weimer writes: > Is there a way to specify a storage pool (or something similar) on the > allocator, and not on the access type? Ada 2012 has such a feature. Instead of: X := new T'(This => 123, That => 456); which allocates in T's storage pool, you can say: X := new (My_Pool) T'(This => 123, That => 456); which allocates in My_Pool. Look up "subpools" in the Ada 2012 RM for details. For "placement new", you will want to write a pool that takes an address-to-allocate-at as a discriminant. - Bob