From: Michael Hope <michaelh@ju...> - 2001-08-09 19:59:13
On Thu, 9 Aug 2001, Dominic Morris wrote:
> On Thu, 9 Aug 2001, Michael Hope wrote:
> > That seems OK to me. char x = "blah" defines a modifiable 5 byte array
> > of chars, that is initialised with the charaters making up 'blah\0'.
> > const char x = "blah" defines an unmodifiable array which is completly
> > stored in code space.
> Yes, it is modifiable I agree, and as such it should be initialised in
> GSINIT, but is right to store it (unreferenced) with the const strings
> when it is not const, in addition to initialising it in GSINIT. This just
> seems slightly wasteful in terms of memory.
Ah, I see. There is the version in GSINIT which is copied out into the
data area, and there is an extra copy of the string in the code area.
That looks like a bug.