re PR libgcj/10596 (Reference and String.intern don't work together)

PR libgcj/10596:
	* include/jvm.h (_Jv_FinalizeString,
	_Jv_RegisterStringFinalizer): Declare.
	* java/lang/natString.cc (_Jv_FinalizeString): Renamed from
	unintern.
	(intern): Updated.
	(_Jv_NewStringUtf8Const): Likewise.
	* java/lang/ref/natReference.cc (finalize_referred_to_object):
	Add special case when finalizing a String.
	(in_hash): New function.
	(_Jv_RegisterStringFinalizer): Likewise.
	(maybe_add_finalize): Likewise.

From-SVN: r71915
This commit is contained in:
Tom Tromey
2003-09-29 21:13:55 +00:00
committed by Tom Tromey
parent 51ac684e52
commit 2cd5614273
4 changed files with 116 additions and 26 deletions

View File

@@ -290,6 +290,12 @@ void _Jv_GCRegisterDisappearingLink (jobject *objp);
implement soft references. */
jboolean _Jv_GCCanReclaimSoftReference (jobject obj);
/* Register a finalizer for a String object. This is only used by
the intern() implementation. */
void _Jv_RegisterStringFinalizer (jobject str);
/* This is called to actually finalize a possibly-intern()d String. */
void _Jv_FinalizeString (jobject str);
/* Return approximation of total size of heap. */
long _Jv_GCTotalMemory (void);
/* Return approximation of total free memory. */