This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj internals documentation


>>>>> "Adam" == Adam Megacz <adam@megacz.com> writes:

Adam> Tom Tromey <tromey@redhat.com> writes:
>> The other is that StringBuilder, which is not synchronized, requires a
>> second allocation at toString time -- even if the StringBuilder does
>> not escape the thread and is dead after the call (since we don't
>> detect this).

Adam> Hrm, why doesn't StringBuilder have a "boolean shared" field like
Adam> StringBuffer does?  I really like that trick ;)

StringBuilder is unsynchronized, and it can be used after toString is
called.  So, there's no way to implement this.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]