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: Tue, 03 Apr 2007 17:17:22 +0200 Message-ID: User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:u0e6zpvJ0/I+b+KrpmkuRgLYPqA= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.74.34.145 X-Trace: news.arcor-ip.de 1175613017 88.74.34.145 (3 Apr 2007 17:10:17 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news1.google.com comp.lang.ada:14778 Date: 2007-04-03T17:17:22+02:00 List-Id: 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(). Another option: Allocate objects in a loop and observe when sbrk() occurs. Regards -- Markus