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!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.251.MISMATCH!news-out.readnews.com!transit4.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit Date: Wed, 04 Apr 2007 13:16:08 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> <20070403153747.1c4f46ef@cube.tz.axivion.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1175706968 2457 192.74.137.71 (4 Apr 2007 17:16:08 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 4 Apr 2007 17:16:08 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:DXxIyMHQT/fWTLPWPkGPNHI6k4Q= Xref: g2news1.google.com comp.lang.ada:14785 Date: 2007-04-04T13:16:08-04:00 List-Id: Markus E Leypold writes: > Stefan Bellon writes: > >> Martin Krischik wrote: >> >>> 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. >> >> Exactly. :-) > > > I'm only guessing, but here is my approach for GNAT: GNAT is AFAIK > linked against libc (at least on Unix). On linux that is glibc, which > provides methods to catch/trace malloc() requests. My suggestion is > that you do that and look which sizes are actually requested from > malloc(). That won't quite give the right answer, because malloc() adds a couple of words or so to what was requested. - Bob