Christian Thalinger
Edwin Steiner
- $Id: jni.c 4900 2006-05-11 09:18:28Z twisti $
+ $Id: jni.c 4901 2006-05-11 12:18:55Z twisti $
*/
key = ((u4) (ptrint) globalRef) >> 4; /* align to 16-byte boundaries */
slot = key & (hashtable_global_ref->size - 1);
gre = hashtable_global_ref->ptr[slot];
-
+
+ /* initialize prevgre */
+
+ prevgre = NULL;
+
/* search external hash chain for the entry */
while (gre) {
/* if reference count is 0, remove the entry */
if (gre->refs == 0) {
- prevgre->hashlink = gre->hashlink;
+ /* special handling if it's the first in the chain */
+
+ if (prevgre == NULL)
+ hashtable_global_ref->ptr[slot] = gre->hashlink;
+ else
+ prevgre->hashlink = gre->hashlink;
FREE(gre, hashtable_global_ref_entry);
}