Paul Brook wrote:
> Contrary to popular belief the "const" qualifier on pointers has
> absolutely no effect on optimization. It's simply a debugging aid so
> the compiler will generate an error if you accidentally assign to
> it.
That's only true when the "const" applies to pointer targets, as in:
On Wed, Aug 24, 2005 at 02:41:44PM +0100, Paul Brook wrote:
> > Probably more important is to make sure none constant data structures
> > are done on the stack. There is no good reason why any code page
> > should be read-write.
>
> Huh? this is nonsense.
I stand corrected, I ment to say on
On Wednesday 24 August 2005 15:38, Andreas Mohr wrote:
> Hi,
>
> On Wed, Aug 24, 2005 at 02:41:44PM +0100, Paul Brook wrote:
> > > Probably more important is to make sure none constant data structures
> > > are done on the stack. There is no good reason why any code page
> > > should be read-write
Hi,
On Wed, Aug 24, 2005 at 02:41:44PM +0100, Paul Brook wrote:
> > Probably more important is to make sure none constant data structures
> > are done on the stack. There is no good reason why any code page
> > should be read-write.
>
> Huh? this is nonsense.
Uhoh, I seem to have managed to sti
> Probably more important is to make sure none constant data structures
> are done on the stack. There is no good reason why any code page
> should be read-write.
Huh? this is nonsense.
You have three segements in an application (ignoring dynamic heap allocated
memory):
The RO segment that con
My own experience is the effect of these types of optimizations is
usually negligible, although it is still the first thing I do when
optimizing a program. The main improvement I find is reducing the
time required to initialize variables and improved code readability.
If you know values are const
Hello Andreas!
> Introduction part:
> --
> I'm doing a performance tuning effort all over the place in
> frequently-used Linux programs:
> I'm trying to mark as many data areas as possible const (and static)
> in various programs (at those places where it's actually feasible,
> that is).
Hello all,
Introduction part:
--
I'm doing a performance tuning effort all over the place in
frequently-used Linux programs:
I'm trying to mark as many data areas as possible const (and static)
in various programs (at those places where it's actually feasible,
that is).
This should have t