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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7af3eb61e15f9a0b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-17 18:19:27 PST Path: archiver1.google.com!news1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: pointer movement? Date: 17 Nov 2001 18:19:26 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0111171819.d56766d@posting.google.com> References: <9t5ihf$dp$1@news.tpi.pl> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1006049966 28290 127.0.0.1 (18 Nov 2001 02:19:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 18 Nov 2001 02:19:26 GMT Xref: archiver1.google.com comp.lang.ada:16663 Date: 2001-11-18T02:19:26+00:00 List-Id: "Andrzej Rybczynski" wrote in message news:<9t5ihf$dp$1@news.tpi.pl>... > I want to do some transformations of large bitmap (dynamically > allocated). With c/c++ I used to do this by moving pointer from > pixel to pixel over all array. What is most important - it has to be > extremely fast. How should I do this in Ada? Can I use package > System.Storage_Elements for this purpose ? It is a fallacy that having roaming pointers C style will improve efficiency. In fact, this sloppy use of pointers often makes it impossible for a C compiler to do proper aliasing analysis. Declare an array, reference it in the obvious manner, and for the most typical code, normal optimizations should bring you back to at least the C code efficiency, and if you use a compiler with good aliasing analysis, perhaps better.