aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:34:13 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-09-22 10:34:13 -0400
commit6f18718f3ff7a4b87bacd842f10582dc0cd87a08 (patch)
tree0fee4857221f022433a9220b0bf7b93cf480ea92 /gcc/objc
parented40285ff6b9ba382020c24c69af8940532f6761 (diff)
downloadgcc-6f18718f3ff7a4b87bacd842f10582dc0cd87a08.zip
gcc-6f18718f3ff7a4b87bacd842f10582dc0cd87a08.tar.gz
gcc-6f18718f3ff7a4b87bacd842f10582dc0cd87a08.tar.bz2
Replace use of __objc_xcalloc and free with objc_calloc and objc_free.
From-SVN: r12761
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/hash.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/objc/hash.c b/gcc/objc/hash.c
index 6d67aa0..4a1dca9 100644
--- a/gcc/objc/hash.c
+++ b/gcc/objc/hash.c
@@ -39,8 +39,6 @@ Boston, MA 02111-1307, USA. */
#define EXPANSION(cache) \
((cache)->size * 2)
-void *__objc_xcalloc (size_t, size_t);
-
cache_ptr
hash_new (unsigned int size, hash_func_type hash_func,
compare_func_type compare_func)
@@ -53,13 +51,13 @@ hash_new (unsigned int size, hash_func_type hash_func,
/* Allocate the cache structure. calloc insures
its initialization for default values. */
- cache = (cache_ptr) __objc_xcalloc (1, sizeof (struct cache));
+ cache = (cache_ptr) objc_calloc (1, sizeof (struct cache));
assert (cache);
/* Allocate the array of buckets for the cache.
calloc initializes all of the pointers to NULL. */
cache->node_table
- = (node_ptr *) __objc_xcalloc (size, sizeof (node_ptr));
+ = (node_ptr *) objc_calloc (size, sizeof (node_ptr));
assert (cache->node_table);
cache->size = size;
@@ -89,8 +87,8 @@ hash_delete (cache_ptr cache)
hash_remove (cache, node->key);
/* Release the array of nodes and the cache itself. */
- free (cache->node_table);
- free (cache);
+ objc_free(cache->node_table);
+ objc_free(cache);
}
@@ -98,7 +96,7 @@ void
hash_add (cache_ptr *cachep, const void *key, void *value)
{
size_t indx = (*(*cachep)->hash_func)(*cachep, key);
- node_ptr node = (node_ptr) __objc_xcalloc (1, sizeof (struct cache_node));
+ node_ptr node = (node_ptr) objc_calloc (1, sizeof (struct cache_node));
assert (node);
@@ -171,7 +169,7 @@ hash_remove (cache_ptr cache, const void *key)
/* Special case. First element is the key/value pair to be removed. */
if ((*cache->compare_func)(node->key, key)) {
cache->node_table[indx] = node->next;
- free (node);
+ objc_free(node);
} else {
/* Otherwise, find the hash entry. */
@@ -182,7 +180,7 @@ hash_remove (cache_ptr cache, const void *key)
if ((*cache->compare_func)(node->key, key)) {
prev->next = node->next, removed = YES;
- free (node);
+ objc_free(node);
} else
prev = node, node = node->next;
} while (!removed && node);