Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Jamie Lokier
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:

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Doctor Bill
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

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Paul Brook
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

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Andreas Mohr
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

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Paul Brook
> 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

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-24 Thread Doctor Bill
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

Re: [Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-23 Thread Mulyadi Santosa
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).

[Qemu-devel] [PATCH] const / static (against current CVS)

2005-08-23 Thread Andreas Mohr
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