|
From: | Artur Biesiadowski |
Subject: | Re: An interessting change for shared char[] in String/StringBuffer |
Date: | Thu, 08 Apr 2004 01:24:10 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 |
Tom Tromey wrote:
From http://java.sun.com/j2se/1.5.0/jcp/beta1/index.html#java.lang: "In this release, the sharing between String and StringBuffer has been eliminated." Does this mean to change to change the implementation in Classpath too? I like this optimization...I don't think we necessarily have to change this. IMO it would depend on whether the change is observable by user code. Our implementation doesn't always share, anyway. It only shares if the buffer is mostly in use.
'Observable by user code' is very broad term. It is possible to write a short program which will throw OutOfMemoryException with sharing on and work without problems when data is always copied - does it counts as observation from user code ?
Artur
[Prev in Thread] | Current Thread | [Next in Thread] |