Re: RFC: String cleanup
- From: Stephen Pollei <stephen pollei gmail com>
- To: Benoît Dejean <benoit placenet org>
- Cc: gtk-devel-list gnome org, Daniel Marjamäki <daniel marjamaki comhem se>, Xavier Bestel <xavier bestel free fr>
- Subject: Re: RFC: String cleanup
- Date: Fri, 16 Dec 2005 14:23:14 -0800
On 12/16/05, Benoît Dejean <benoit placenet org> wrote:
> Le vendredi 16 décembre 2005 à 16:16 +0100, Xavier Bestel a écrit :
> > On Fri, 2005-12-16 at 16:11, Benoît Dejean wrote:
> > > Isn't that exactly the same ?
> > const char str is a string of chars (and a symbol pointing of them).
> > const char *str is a string of char and a pointer on them (and a
> > symbol).
> I don't get it. To me, it's is exactly the same, the  notation giving
> extra information that str is going to be used like an array.
const char * const str is much closer to being equivalent to const char str .
A constant pointer to constant characters. So either giving more const
hints or using the array notation, might give more hints to the
optimizer which may or may not cause changes to the outputed code.
> > that's one more printer in memory, and a dereferenciation.
] [Thread Prev