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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5653f0bd43045b85 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: garbage collection [storage pools] Date: 1999/08/21 Message-ID: <7pma4f$jle$1@nnrp1.deja.com>#1/1 X-Deja-AN: 515470523 References: <37be0c85@news1.us.ibm.net> X-Http-Proxy: 1.0 x25.deja.com:80 (Squid/1.1.22) for client 166.72.82.184 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Sat Aug 21 13:38:22 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-08-21T00:00:00+00:00 List-Id: In article <37be0c85@news1.us.ibm.net>, "Matthew Heaney" wrote: > One thing I miss is not having a set of nameable, pre-defined > storage pools. > You have that in GNAT, but it's not really portable because of > certain > low-level calls (to a C routine called "_gnat__allocate", or > something like > that). Well it is unlikely that implementations of storage pools will be completely portable in any case, because they will undoubtedly do implementation defined stuff using unchecked conversions, address arithmetic, calls to library routines etc. So it is probably not a good idea to try to insist on portable implementations. It would be VERY nice to have a standard set of storage pools with standard interfaces. This is an excellent area to suggest to the ARG for future standardization. In GNAT, we provide the following Stack_Bounded_Pool really intended only for internal use, implements the allocation strategy for fixed size objects when a storage size clause is present. Unbounded_No_Reclaim_Pool again really intended for internal use, this is the default storage pool that simply allocates from the heap Unbounded_Reclaim_Pool this is the one that I have mentioned before, it provides a local allocation capability where the objects are all freed automatically on scope exit Checked_Pool this is like the standard unbounded no reclaim pool, but has a dereference procedure that is called on each dereference of an object in the pool. This is still an abstract pool, the user must specialize it with an appropriate extension to provide a useful definition for dereference. This is really a language extension (of the allowed kind, provided by a package). Debug_Pool this is like the standard unbounded no reclaim pool, but it maintains extra overhead to do full validity checking on all operations. This is useful for tracking down storage leaks. One can think of many more useful pools, most notably one that provides defined worst case bounded time performance for real time use. It would also be useful to standardize a pragma to override the normal default storage pool (we plan adding such a pragma to the next version of GNAT). Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.