comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: pointer movement?
Date: 17 Nov 2001 18:19:26 -0800
Date: 2001-11-18T02:19:26+00:00	[thread overview]
Message-ID: <5ee5b646.0111171819.d56766d@posting.google.com> (raw)
In-Reply-To: 9t5ihf$dp$1@news.tpi.pl

"Andrzej Rybczynski" <arybczyn@lafot.com> 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.



  parent reply	other threads:[~2001-11-18  2:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-17 11:39 pointer movement? Andrzej Rybczynski
2001-11-17 17:54 ` Nick Roberts
2001-11-18  2:19 ` Robert Dewar [this message]
2001-11-18  3:00   ` DuckE
2001-11-19 13:05     ` John R. Strohm
2001-11-19 15:03       ` DuckE
  -- strict thread matches above, loose matches on Subject: below --
2001-11-17 14:18 Gautier Write-only-address
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox