aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:49:59 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:49:59 -0400
commit039f5fb1a88e320122a4120946f639fd0300d726 (patch)
tree22793b97c11855251d092a65acd76e061d56964f
parentdf7fbc8cd830ea212f052c089989afb014e3ffe3 (diff)
downloadgcc-039f5fb1a88e320122a4120946f639fd0300d726.zip
gcc-039f5fb1a88e320122a4120946f639fd0300d726.tar.gz
gcc-039f5fb1a88e320122a4120946f639fd0300d726.tar.bz2
Replace use of __objc_xmalloc and free with objc_malloc and objc_free.
From-SVN: r12768
-rw-r--r--gcc/objc/sarray.c32
-rw-r--r--gcc/objc/thr-decosf1.c6
-rw-r--r--gcc/objc/thr-irix.c6
-rw-r--r--gcc/objc/thr-mach.c6
-rw-r--r--gcc/objc/thr-os2.c4
-rw-r--r--gcc/objc/thr-posix.c6
-rw-r--r--gcc/objc/thr-pthreads.c6
-rw-r--r--gcc/objc/thr-single.c4
-rw-r--r--gcc/objc/thr-solaris.c6
-rw-r--r--gcc/objc/thr-win32.c6
-rw-r--r--gcc/objc/thr.c6
11 files changed, 44 insertions, 44 deletions
diff --git a/gcc/objc/sarray.c b/gcc/objc/sarray.c
index fec92b1..7e40fba 100644
--- a/gcc/objc/sarray.c
+++ b/gcc/objc/sarray.c
@@ -63,7 +63,7 @@ sarray_remove_garbage(void)
while (vp) {
np = *vp;
- free(vp);
+ objc_free(vp);
vp = np;
}
@@ -80,7 +80,7 @@ sarray_free_garbage(void *vp)
objc_mutex_lock(__objc_runtime_mutex);
if (__objc_runtime_threads_alive == 1) {
- free(vp);
+ objc_free(vp);
if (first_free_data)
sarray_remove_garbage();
}
@@ -145,7 +145,7 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
if ((*the_index) == array->empty_index) {
/* The index was previously empty, allocate a new */
- new_index = (struct sindex*)__objc_xmalloc(sizeof(struct sindex));
+ new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
memcpy(new_index, array->empty_index, sizeof(struct sindex));
new_index->version.version = array->version.version;
*the_index = new_index; /* Prepared for install. */
@@ -156,7 +156,7 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
/* This index must be lazy copied */
struct sindex* old_index = *the_index;
- new_index = (struct sindex*)__objc_xmalloc(sizeof(struct sindex));
+ new_index = (struct sindex*)objc_malloc(sizeof(struct sindex));
memcpy( new_index, old_index, sizeof(struct sindex));
new_index->version.version = array->version.version;
*the_index = new_index; /* Prepared for install. */
@@ -173,7 +173,7 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
/* The bucket was previously empty (or something like that), */
/* allocate a new. This is the effect of `lazy' allocation */
- new_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket));
+ new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
memcpy((void *) new_bucket, (const void*)array->empty_bucket,
sizeof(struct sbucket));
new_bucket->version.version = array->version.version;
@@ -185,7 +185,7 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
/* Perform lazy copy. */
struct sbucket* old_bucket = *the_bucket;
- new_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket));
+ new_bucket = (struct sbucket*)objc_malloc(sizeof(struct sbucket));
memcpy( new_bucket, old_bucket, sizeof(struct sbucket));
new_bucket->version.version = array->version.version;
*the_bucket = new_bucket; /* Prepared for install. */
@@ -220,16 +220,16 @@ sarray_new (int size, void* default_element)
assert(size > 0);
/* Allocate core array */
- arr = (struct sarray*) __objc_xmalloc(sizeof(struct sarray));
+ arr = (struct sarray*) objc_malloc(sizeof(struct sarray));
arr->version.version = 0;
/* Initialize members */
#ifdef OBJC_SPARSE3
arr->capacity = num_indices*INDEX_CAPACITY;
new_indices = (struct sindex**)
- __objc_xmalloc(sizeof(struct sindex*)*num_indices);
+ objc_malloc(sizeof(struct sindex*)*num_indices);
- arr->empty_index = (struct sindex*) __objc_xmalloc(sizeof(struct sindex));
+ arr->empty_index = (struct sindex*) objc_malloc(sizeof(struct sindex));
arr->empty_index->version.version = 0;
narrays += 1;
@@ -239,14 +239,14 @@ sarray_new (int size, void* default_element)
#else /* OBJC_SPARSE2 */
arr->capacity = num_indices*BUCKET_SIZE;
new_buckets = (struct sbucket**)
- __objc_xmalloc(sizeof(struct sbucket*)*num_indices);
+ objc_malloc(sizeof(struct sbucket*)*num_indices);
narrays += 1;
idxsize += num_indices;
#endif
- arr->empty_bucket = (struct sbucket*) __objc_xmalloc(sizeof(struct sbucket));
+ arr->empty_bucket = (struct sbucket*) objc_malloc(sizeof(struct sbucket));
arr->empty_bucket->version.version = 0;
nbuckets += 1;
@@ -337,11 +337,11 @@ sarray_realloc(struct sarray* array, int newsize)
/* alloc to force re-read by any concurrent readers. */
old_indices = array->indices;
new_indices = (struct sindex**)
- __objc_xmalloc((new_max_index+1)*sizeof(struct sindex*));
+ objc_malloc((new_max_index+1)*sizeof(struct sindex*));
#else /* OBJC_SPARSE2 */
old_buckets = array->buckets;
new_buckets = (struct sbucket**)
- __objc_xmalloc((new_max_index+1)*sizeof(struct sbucket*));
+ objc_malloc((new_max_index+1)*sizeof(struct sbucket*));
#endif
/* copy buckets below old_max_index (they are still valid) */
@@ -488,7 +488,7 @@ sarray_lazy_copy(struct sarray* oarr)
#endif
/* Allocate core array */
- arr = (struct sarray*) __objc_xmalloc(sizeof(struct sarray)); /* !!! */
+ arr = (struct sarray*) objc_malloc(sizeof(struct sarray)); /* !!! */
arr->version.version = oarr->version.version + 1;
#ifdef OBJC_SPARSE3
arr->empty_index = oarr->empty_index;
@@ -502,14 +502,14 @@ sarray_lazy_copy(struct sarray* oarr)
#ifdef OBJC_SPARSE3
/* Copy bucket table */
new_indices = (struct sindex**)
- __objc_xmalloc(sizeof(struct sindex*)*num_indices);
+ objc_malloc(sizeof(struct sindex*)*num_indices);
memcpy( new_indices,oarr->indices,
sizeof(struct sindex*)*num_indices);
arr->indices = new_indices;
#else
/* Copy bucket table */
new_buckets = (struct sbucket**)
- __objc_xmalloc(sizeof(struct sbucket*)*num_indices);
+ objc_malloc(sizeof(struct sbucket*)*num_indices);
memcpy( new_buckets,oarr->buckets,
sizeof(struct sbucket*)*num_indices);
arr->buckets = new_buckets;
diff --git a/gcc/objc/thr-decosf1.c b/gcc/objc/thr-decosf1.c
index 69074a4..f3641e9 100644
--- a/gcc/objc/thr-decosf1.c
+++ b/gcc/objc/thr-decosf1.c
@@ -211,13 +211,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 = pthread_mutex_init(&mutex->lock, pthread_mutexattr_default);
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. */
@@ -244,7 +244,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
pthread_mutex_unlock(&mutex->lock); /* Must unlock system mutex.*/
pthread_mutex_destroy(&mutex->lock); /* Free system mutex. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-irix.c b/gcc/objc/thr-irix.c
index ca9fca0..e1042f0 100644
--- a/gcc/objc/thr-irix.c
+++ b/gcc/objc/thr-irix.c
@@ -191,14 +191,14 @@ 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. */
if (!(mutex->lock = usnewlock(__objc_shared_arena_handle)))
err = -1;
if (err != 0) { /* System init failed? */
- free(mutex); /* Yes, free local memory. */
+ objc_free(mutex); /* Yes, free local memory. */
return NULL; /* Abort. */
}
mutex->owner = NULL; /* No owner. */
@@ -224,7 +224,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
usfreelock(mutex->lock, __objc_shared_arena_handle); /* Free IRIX lock. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-mach.c b/gcc/objc/thr-mach.c
index ad04a3d..e070413 100644
--- a/gcc/objc/thr-mach.c
+++ b/gcc/objc/thr-mach.c
@@ -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. */
}
diff --git a/gcc/objc/thr-os2.c b/gcc/objc/thr-os2.c
index 470ab87..c36cad8 100644
--- a/gcc/objc/thr-os2.c
+++ b/gcc/objc/thr-os2.c
@@ -228,7 +228,7 @@ 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. */
if (DosCreateMutexSem (NULL,&(mutex->handle),0L,0) > 0) {
@@ -259,7 +259,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
DosCloseMutexSem (mutex->handle);
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-posix.c b/gcc/objc/thr-posix.c
index e2a98d2..efe8bff 100644
--- a/gcc/objc/thr-posix.c
+++ b/gcc/objc/thr-posix.c
@@ -209,13 +209,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 = pthread_mutex_init(&mutex->lock, NULL);
if (err != 0) { /* System init failed? */
- free(mutex); /* Yes, free local memory. */
+ objc_free(mutex); /* Yes, free local memory. */
return NULL; /* Abort. */
}
mutex->owner = NULL; /* No owner. */
@@ -242,7 +242,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
pthread_mutex_unlock(&mutex->lock); /* Must unlock system mutex.*/
pthread_mutex_destroy(&mutex->lock); /* Free system mutex. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-pthreads.c b/gcc/objc/thr-pthreads.c
index 27ecbb6..112f113 100644
--- a/gcc/objc/thr-pthreads.c
+++ b/gcc/objc/thr-pthreads.c
@@ -183,14 +183,14 @@ objc_mutex_allocate(void)
{
_objc_mutex_t mutex;
- 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. */
/* Create PCThread mutex */
if ( pthread_mutex_init(&(mutex->mutex), NULL) )
{
/* Failed */
- free(mutex);
+ objc_free(mutex);
return NULL;
}
@@ -218,7 +218,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
/* Destroy PCThread mutex */
pthread_mutex_destroy(&(mutex->mutex));
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-single.c b/gcc/objc/thr-single.c
index 5ab416d..77973d3 100644
--- a/gcc/objc/thr-single.c
+++ b/gcc/objc/thr-single.c
@@ -142,7 +142,7 @@ objc_mutex_allocate(void)
{
_objc_mutex_t mutex;
- 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. */
mutex->owner = NULL; /* No owner. */
@@ -166,7 +166,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
return -1; /* Yes, abort. */
depth = objc_mutex_lock(mutex); /* Must have lock. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-solaris.c b/gcc/objc/thr-solaris.c
index 75fad21..1a843be 100644
--- a/gcc/objc/thr-solaris.c
+++ b/gcc/objc/thr-solaris.c
@@ -213,13 +213,13 @@ objc_mutex_allocate(void)
struct _objc_mutex *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, USYNC_THREAD, 0);
if (err != 0) { /* System init failed? */
- free(mutex); /* Yes, free local memory. */
+ objc_free(mutex); /* Yes, free local memory. */
return NULL; /* Abort. */
}
mutex->owner = NULL; /* No owner. */
@@ -245,7 +245,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
mutex_destroy(&mutex->lock); /* System deallocate. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr-win32.c b/gcc/objc/thr-win32.c
index 4a846c8..37e9876 100644
--- a/gcc/objc/thr-win32.c
+++ b/gcc/objc/thr-win32.c
@@ -220,11 +220,11 @@ 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. */
if ((mutex->handle = CreateMutex(NULL, 0, NULL)) == NULL) {
- free(mutex); /* Failed, free memory. */
+ objc_free(mutex); /* Failed, free memory. */
return NULL; /* Abort. */
}
mutex->owner = NULL; /* No owner. */
@@ -250,7 +250,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
CloseHandle(mutex->handle); /* Close Win32 handle. */
- free(mutex); /* Free memory. */
+ objc_free(mutex); /* Free memory. */
return depth; /* Return last depth. */
}
diff --git a/gcc/objc/thr.c b/gcc/objc/thr.c
index 4b8c2fc..aca0ca0 100644
--- a/gcc/objc/thr.c
+++ b/gcc/objc/thr.c
@@ -79,7 +79,7 @@ __objc_thread_detach_function(struct __objc_thread_start_state *istate)
id object = istate->object;
id argument = istate->argument;
- free(istate);
+ objc_free(istate);
/* Clear out the thread local storage */
objc_thread_set_data(NULL);
@@ -117,7 +117,7 @@ objc_thread_detach(SEL selector, id object, id argument)
_objc_thread_t thread_id = NULL; /* Detached thread id. */
if (!(istate = (struct __objc_thread_start_state *)
- __objc_xmalloc(sizeof(*istate)))) /* Can we allocate state? */
+ objc_malloc(sizeof(*istate)))) /* Can we allocate state? */
return NULL; /* No, abort. */
istate->selector = selector; /* Initialize the thread's */
@@ -126,7 +126,7 @@ objc_thread_detach(SEL selector, id object, id argument)
if ((thread_id = objc_thread_create((void *)__objc_thread_detach_function,
istate)) == NULL) {
- free(istate); /* Release state if failed. */
+ objc_free(istate); /* Release state if failed. */
return thread_id;
}