_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. */
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. */
}