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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,15480fcd593513b9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!e18g2000vbe.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Newsgroups: comp.lang.ada Subject: Re: Table of pointers question Date: Fri, 25 Sep 2009 09:52:12 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 78.82.58.64 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1253897532 9273 127.0.0.1 (25 Sep 2009 16:52:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Sep 2009 16:52:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e18g2000vbe.googlegroups.com; posting-host=78.82.58.64; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8469 Date: 2009-09-25T09:52:12-07:00 List-Id: On 24 Sep, 03:34, Adam Beneschan wrote: > The advantages of using an array of pointers is > that a pointer is smaller than a DirectoryEntryType (and in a real- > life application, it could be MUCH smaller), so if NumberOfEntries is, > say, 15, allocating a fixed-size array of 1000 pointers and waiting > until runtime to allocate 15 DirectoryEntryTypes takes a lot less > memory than allocating 1000 DirectoryEntryTypes. ..... >=A0Also, when you do the > exchange, you're moving two pointers around rather than moving two > DirectoryEntryTypes, which is a lot faster since the pointers are > smaller. Is this true? Should one not expect the compiler to figure that out, so what is shuffled around, and memory allocated for, is for pointers, and not their content? Or do I have too much faith in compilers /Bj=F6rn Bj=F6rn Lundin