OSDN Git Service

Replace use of __objc_xmalloc and free with objc_malloc and objc_free.
[pf3gnuchains/gcc-fork.git] / gcc / objc / thr-mach.c
index ad04a3d..e070413 100644 (file)
@@ -250,13 +250,13 @@ objc_mutex_allocate(void)
     _objc_mutex_t mutex;
     int         err = 0;
     
-    if (!(mutex = (_objc_mutex_t)__objc_xmalloc(sizeof(struct _objc_mutex))))
+    if (!(mutex = (_objc_mutex_t) objc_malloc(sizeof(struct _objc_mutex))))
         return NULL;                            /* Abort if malloc failed.  */
 
     err = mutex_init(&(mutex->lock));
     
     if (err != 0) {                             /* System init failed?      */
-        free(mutex);                            /* Yes, free local memory.  */
+        objc_free(mutex);                       /* Yes, free local memory.  */
         return NULL;                            /* Abort.                   */
     }
     mutex->owner = (_objc_thread_t) -1;         /* No owner.                */
@@ -283,7 +283,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
     mutex_unlock(&(mutex->lock));               /* Must unlock system mutex.*/
     mutex_clear(&(mutex->lock));                /* Free system mutex.       */
     
-    free(mutex);                                /* Free memory.             */
+    objc_free(mutex);                           /* Free memory.             */
     return depth;                               /* Return last depth.       */
 }