Douglas Walls wrote:
> 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.

My comment was about "identical read-only objects", e.g. the everything
which is |const| and not only "string literals". String literals are
already covered by "-xstrconst" but AFAIK a second (seperate) option
would be nice which folds all identical |const| _objects_ together, even
if it would be something like |const int16 x1 = 0xbeef; const int32 x2 =
0xdeadbeef;| where the address of |x1| could AFAIK (in theory) point to
the space of the "beef" part of |x2|.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to