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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-17 05:14:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!grolier!club-internet!not-for-mail From: Laurent Guerby Newsgroups: comp.lang.ada Subject: Support for per allocation pool selection (was: Better support for garbage collection) Date: 17 Mar 2001 14:14:07 +0100 Organization: Club-Internet (France) Message-ID: <86itl8v8ps.fsf_-_@acm.org> References: <98m938$2iod0$1@ID-25716.news.dfncis.de> <861ys03t2f.fsf@acm.org> <86bsr15wft.fsf@acm.org> NNTP-Posting-Host: nas20-26.vlt.club-internet.fr X-Trace: front3m.grolier.fr 984834652 102 195.36.170.26 (17 Mar 2001 13:10:52 GMT) NNTP-Posting-Date: 17 Mar 2001 13:10:52 GMT X-Newsreader: Gnus v5.7/Emacs 20.5 Xref: supernews.google.com comp.lang.ada:5802 Date: 2001-03-17T13:10:52+00:00 List-Id: Robert A Duff writes: > My plan is to have a package that keeps track of the "current pool", > with a Set_Current_Pool operation, or some such. And a storage pool > that redirects Allocate requests to the current pool. This is somewhat > error prone. It is also not task safe, and adding locks would be too > inefficient (I think). If Ada had task-local storage, I could make it > task safe, but still error prone. Okay I see. > > You also need a new version of Unchecked_Deallocation with an > > additional parameter, but no new syntax needed here (and with > > overloading, no new name). > U_D is a generic, and is a library unit, and overloading is not > allowed for generics, nor for lib units. So new name needed ;-). Note that close to your Set_Current_Pool idea, we can propose a pragma to do so: pragma Use_Pool_Object (T_Ptr, Pool_Object); then all allocations (via new) of type T_Ptr use the given Pool_Object in the current scope (and until the next pragma), no new syntax then. No other people have expressed interest so far. Do you think if I write down a proposal, it would be considered? For reference: > The obvious new T'(Pool_Object, Value) doesn't work unfortunately, so > may be: > > new T'(Value) at Pool_Object -- may be replace "at" by use/of/with/in??? > > [...] I see no way to include the allocation part of this feature without > new syntax, due to the way 4.8 is written: > > 4.7: > qualified_expression ::= > subtype_mark'(expression) | subtype_mark'aggregate > > If other people have ideas. -- Laurent Guerby