Roland Mainz wrote:
Joerg Schilling wrote:
Peter Memishian <[EMAIL PROTECTED]> wrote:
> I think this is more in the range of megabytes since the kernel is full
> of duplicate strings.
The waste is certainly noticeable on DEBUG kernels. In fact, there's
currently a P1 bug (6522961) open that DEBUG kernels are overflowing the
4M nucleus text page because of all the duplicate text strings in ASSERT()
messages (especially __FILE__). Roland, you will be happy to hear that
one of the proposals on the table is to enable -xstrconst for the kernel.
I am not sure whether the compiler will ever be able to avoid duplicate
strings that result from strinmgs in different source files.
That's why I suggested a new compiler/linker option to fold identical
read-only objects together (AFAIK a violation of the ISO C standard but
it may still be usefull).
Nothing in ISO C standard disallows this. ISO C explicitly states
that changing the value of a string literal is undefined behavior.
So placing them in read-only sections and folding them together is
undetectable in a conforming program.
Douglas
Head of U.S. Delegation to WG14 (the ISO/SC22 C programming language working
group)
----
Bye,
Roland
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code