PatchSet 7137 
Date: 2006/03/04 21:28:20
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
use gc_free instead of KFREE where appropriate in string module

2006-03-04  Dalibor Topic  <[EMAIL PROTECTED]>

        * kaffe/kaffevm/string.c: Use gc_free instead of KFREE where
        appropriate.

Members: 
        ChangeLog:1.4655->1.4656 
        kaffe/kaffevm/string.c:1.46->1.47 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4655 kaffe/ChangeLog:1.4656
--- kaffe/ChangeLog:1.4655      Sat Mar  4 19:41:20 2006
+++ kaffe/ChangeLog     Sat Mar  4 21:28:20 2006
@@ -1,5 +1,10 @@
 2006-03-04  Dalibor Topic  <[EMAIL PROTECTED]>
 
+       * kaffe/kaffevm/string.c: Use gc_free instead of KFREE where
+       appropriate.
+
+2006-03-04  Dalibor Topic  <[EMAIL PROTECTED]>
+
        * kaffe/kaffevm/jit3/constpool.c: Added missing machine.h
        include.
 
Index: kaffe/kaffe/kaffevm/string.c
diff -u kaffe/kaffe/kaffevm/string.c:1.46 kaffe/kaffe/kaffevm/string.c:1.47
--- kaffe/kaffe/kaffevm/string.c:1.46   Sun Feb 12 01:10:42 2006
+++ kaffe/kaffe/kaffevm/string.c        Sat Mar  4 21:28:25 2006
@@ -113,7 +113,7 @@
        /* Return a string containing those chars */
        string = stringCharArray2Java(ary, len);
        if (ary != buf) {
-               KFREE(ary);
+               gc_free(ary);
        }
        return(string);
 }
@@ -199,7 +199,7 @@
        /* Convert to a String object */
        string = stringCharArray2Java(jc, uniLen);
        if (jc != buf) {
-               KFREE(jc);
+               gc_free(jc);
        }
        return(string);
 }
@@ -236,7 +236,7 @@
        utf8buf = utf8ConstEncode(chars, slength);
 
        if (chars != STRING_DATA(str)) {
-               KFREE(chars);
+               gc_free(chars);
        }
 
        if (utf8buf == 0) {
@@ -282,7 +282,7 @@
 
 /*
  * Define functions used by the string hashtable to resize itself.
- * The problem is that we may block in KCALLOC/KFREE and the gc may kick
+ * The problem is that we may block in gc_malloc/gc_free and the gc may kick
  * in.  The collector, however, must be able to call stringUninternString
  * while destroying strings.  If we held the lock while this is happening,
  * we would deadlock.
@@ -304,7 +304,7 @@
 {
        /* XXX assumes stringLock isn't acquired recursively (which it isn't) */
         unlockStaticMutex(&stringLock);        
-       KFREE((void *) ptr);
+       gc_free((void *) ptr);
        lockStaticMutex(&stringLock);
 }
 
@@ -427,12 +427,12 @@
 Hjava_lang_String*
 stringCharArray2Java(const jchar *data, int len)
 {
-       Hjava_lang_String *string;
+        Hjava_lang_String *string;
        HArrayOfChar *ary;
        errorInfo info;
 
        /* Lock intern table 
-        * NB: we must not hold stringLock when we call KMALLOC/KFREE!
+        * NB: we must not hold stringLock when we call gc_malloc/gc_free!
         */
 
        /* Look for it already in the intern hash table */
@@ -465,7 +465,7 @@
                unlockStaticMutex(&stringLock);
 
                if (fakeAry != (HArrayOfChar*)buf) {
-                       KFREE(fakeAry);
+                       gc_free(fakeAry);
                }
                if (string != NULL) {
                        return(string);

_______________________________________________
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to