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,8055158949c56618 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-15 22:20:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Storage Pools and alloca Date: 16 Oct 2002 06:20:50 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1034745612 4630 62.49.19.209 (16 Oct 2002 05:20:12 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 16 Oct 2002 05:20:12 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:29827 Date: 2002-10-16T06:20:50+01:00 List-Id: Robert A Duff writes: > Storage_Size is supposed to return the amount of "reserved" space, > which in virtual memory systems might be zero. ('Storage_Size is > kind of useless, actually. I've never written a program that > queried 'Storage_Size. Has anybody?) We have used Storage_Size clauses where we want to use new/unchecked deallocation rather than managing storage reclamation by hand we know the maximum number of instances we don't want to have lots of malloc/free churn because of rumours about its performance we don't want to have lots of malloc/free churn because of heap fragmentation issues (long-running embedded system, no memory management) As an example, for a maximum on 4 instances, type Handle is access Instance; for Handle'Storage_Size use Instance'Object_Size / 8 * 4; (I know see that perhaps I should have used the standard 'Max_Size_In_Storage_Elements rather than the GNAT 'Object_Size. Oh well, easy to change that sort of thing with a code generator!) As for querying it, well, I think you may be right ..