Commit 62a3446b by Tom Tromey Committed by Tom Tromey

natString.cc (_Jv_AllocString): Initialize cachedHashCode.

	* java/lang/natString.cc (_Jv_AllocString): Initialize
	cachedHashCode.
	(init): Likewise.
	(_Jv_NewStringUtf8Const): Likewise.

From-SVN: r66180
parent 8707fe93
2003-04-27 Tom Tromey <tromey@redhat.com>
* java/lang/natString.cc (_Jv_AllocString): Initialize
cachedHashCode.
(init): Likewise.
(_Jv_NewStringUtf8Const): Likewise.
2003-03-29 Mohan Embar <gnustuff@thisiscool.com> 2003-03-29 Mohan Embar <gnustuff@thisiscool.com>
* include/jvm.h: (_Jv_GetNbArgs) added * include/jvm.h: (_Jv_GetNbArgs) added
......
...@@ -288,6 +288,7 @@ _Jv_NewStringUtf8Const (Utf8Const* str) ...@@ -288,6 +288,7 @@ _Jv_NewStringUtf8Const (Utf8Const* str)
chrs = JvGetStringChars(jstr); chrs = JvGetStringChars(jstr);
memcpy (chrs, buffer, sizeof(jchar)*length); memcpy (chrs, buffer, sizeof(jchar)*length);
} }
jstr->cachedHashCode = hash;
*ptr = jstr; *ptr = jstr;
SET_STRING_IS_INTERNED(jstr); SET_STRING_IS_INTERNED(jstr);
// When string is GC'd, clear the slot in the hash table. // When string is GC'd, clear the slot in the hash table.
...@@ -408,6 +409,7 @@ _Jv_AllocString(jsize len) ...@@ -408,6 +409,7 @@ _Jv_AllocString(jsize len)
obj->data = obj; obj->data = obj;
obj->boffset = sizeof(java::lang::String); obj->boffset = sizeof(java::lang::String);
obj->count = len; obj->count = len;
obj->cachedHashCode = 0;
return obj; return obj;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment