+/* gc_reference_unregister *****************************************************
+
+ Unregister a previously registered external reference.
+
+*******************************************************************************/
+
+static void gc_reference_unregister_intern(list_t *list, java_object_t **ref)
+{
+ list_gcref_entry_t *re;
+
+ /* the global GC lock also guards the reference lists */
+ GC_MUTEX_LOCK;
+
+ GC_LOG2( printf("Un-Registering Reference at %p\n", (void *) ref); );
+
+ /* search for the appropriate reference entry */
+ for (re = list_first(list); re != NULL; re = list_next(list, re)) {
+ if (re->ref == ref) {
+ /* remove the entry from the given list */
+ list_remove(list, re);
+
+ /* free the reference entry */
+ FREE(re, list_gcref_entry_t);
+
+ break;
+ }
+ }
+
+ vm_abort("gc_reference_unregister_intern: reference not found");
+
+ /* the global GC lock also guards the reference lists */
+ GC_MUTEX_UNLOCK;
+}
+