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 Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> <20070403153747.1c4f46ef@cube.tz.axivion.com> From: Markus E Leypold Organization: N/A Date: Thu, 05 Apr 2007 10:55:07 +0200 Message-ID: User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:Tb7zJhTzYDhX7yP64owIUUamgvE= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.193.199 X-Trace: news.arcor-ip.de 1175762878 88.72.193.199 (5 Apr 2007 10:47:58 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!news.unit0.net!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news1.google.com comp.lang.ada:14795 Date: 2007-04-05T10:55:07+02:00 List-Id: Robert A Duff writes: > 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. And I thought it would exactly be the extra padding the OP was interested in? Regards -- Markus