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,427e29f23a651ddb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!usenet-fr.net!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit Date: Tue, 3 Apr 2007 18:53:04 -0500 Organization: Jacob's private Usenet server Message-ID: References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1175644292 29801 69.95.181.76 (3 Apr 2007 23:51:32 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 3 Apr 2007 23:51:32 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:14775 Date: 2007-04-03T18:53:04-05:00 List-Id: "Martin Krischik" wrote in message news:461257ea$1@news.post.ch... ... > So I believe the OP wanted to know how to find out how much memory for > "new"ed object is allocated in total in order to know if extra > optimisation is needed. But that isn't really a meaningful question. It clearly depends on the storage pool, and if the storage pool comes from somewhere else, it may even depend on the OS version you are running. For instance, the standard storage pool in Janus/Ada uses a standard Windows heap. Those exhibit vastly different behavior on Windows 95 than Windows 2000, and somewhat different on almost every version of Windows. Rule of thumb: if the behavior of the standard storage pool actually makes a difference in your application, then don't use it! Write your own storage pool that has the behavior you need. It's relatively easy to do, especially if you have fixed size elements. And then you can effectively use an array to allocate elements and still have cheap insertion and deletion and reordering. Randy.