+ FREE(a, sizeof(java_chararray_t) + sizeof(u2) * (a->header.size - 1)); /* +10 ?? */
+}
+#endif
+
+
+/* javastring_intern ***********************************************************
+
+ Intern the given Java string.
+
+ XXX NOTE: Literal Strings are direct references since they are not placed
+ onto the GC-Heap. That's why this function looks so "different".
+
+*******************************************************************************/
+
+java_handle_t *javastring_intern(java_handle_t *s)
+{
+ java_lang_String *so;
+ java_chararray_t *value;
+ int32_t count;
+ int32_t offset;
+/* java_lang_String *o; */
+ java_object_t *o; /* XXX see note above */
+
+ so = (java_lang_String *) s;
+
+ value = LLNI_field_direct(so, value); /* XXX see note above */
+ LLNI_field_get_val(so, count, count);
+ LLNI_field_get_val(so, offset, offset);
+
+ o = literalstring_u2(value, count, offset, true);
+
+ return LLNI_WRAP(o); /* XXX see note above */
+}
+
+
+/* javastring_fprint ***********************************************************
+
+ Print the given Java string to the given stream.
+
+*******************************************************************************/
+
+void javastring_fprint(java_handle_t *s, FILE *stream)
+{
+ java_lang_String *so;
+ java_handle_chararray_t *value;
+ int32_t count;
+ int32_t offset;
+ uint16_t c;
+ int i;
+
+ so = (java_lang_String *) s;
+
+ LLNI_field_get_ref(so, value, value);
+ LLNI_field_get_val(so, count, count);
+ LLNI_field_get_val(so, offset, offset);
+
+ for (i = offset; i < offset + count; i++) {
+ c = LLNI_array_direct(value, i);
+ fputc(c, stream);
+ }