Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions
diff --git a/src/mesa/shader/prog_cache.c b/src/mesa/shader/prog_cache.c
index 8e54f3a..e5b602f 100644
--- a/src/mesa/shader/prog_cache.c
+++ b/src/mesa/shader/prog_cache.c
@@ -87,7 +87,7 @@
cache->last = NULL;
size = cache->size * 3;
- items = (struct cache_item**) _mesa_malloc(size * sizeof(*items));
+ items = (struct cache_item**) malloc(size * sizeof(*items));
memset(items, 0, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
@@ -97,7 +97,7 @@
items[c->hash % size] = c;
}
- _mesa_free(cache->items);
+ free(cache->items);
cache->items = items;
cache->size = size;
}
@@ -114,9 +114,9 @@
for (i = 0; i < cache->size; i++) {
for (c = cache->items[i]; c; c = next) {
next = c->next;
- _mesa_free(c->key);
+ free(c->key);
_mesa_reference_program(ctx, &c->program, NULL);
- _mesa_free(c);
+ free(c);
}
cache->items[i] = NULL;
}
@@ -134,9 +134,9 @@
if (cache) {
cache->size = 17;
cache->items = (struct cache_item **)
- _mesa_calloc(cache->size * sizeof(struct cache_item));
+ calloc(1, cache->size * sizeof(struct cache_item));
if (!cache->items) {
- _mesa_free(cache);
+ free(cache);
return NULL;
}
}
@@ -148,8 +148,8 @@
_mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache)
{
clear_cache(ctx, cache);
- _mesa_free(cache->items);
- _mesa_free(cache);
+ free(cache->items);
+ free(cache);
}
@@ -188,7 +188,7 @@
c->hash = hash;
- c->key = _mesa_malloc(keysize);
+ c->key = malloc(keysize);
memcpy(c->key, key, keysize);
c->program = program; /* no refcount change */