aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/shader/prog_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/shader/prog_cache.c')
-rw-r--r--mesalib/src/mesa/shader/prog_cache.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mesalib/src/mesa/shader/prog_cache.c b/mesalib/src/mesa/shader/prog_cache.c
index 9437e5961..e5b602fc0 100644
--- a/mesalib/src/mesa/shader/prog_cache.c
+++ b/mesalib/src/mesa/shader/prog_cache.c
@@ -87,8 +87,8 @@ rehash(struct gl_program_cache *cache)
cache->last = NULL;
size = cache->size * 3;
- items = (struct cache_item**) _mesa_malloc(size * sizeof(*items));
- _mesa_memset(items, 0, size * sizeof(*items));
+ items = (struct cache_item**) malloc(size * sizeof(*items));
+ memset(items, 0, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
for (c = cache->items[i]; c; c = next) {
@@ -97,7 +97,7 @@ rehash(struct gl_program_cache *cache)
items[c->hash % size] = c;
}
- _mesa_free(cache->items);
+ free(cache->items);
cache->items = items;
cache->size = size;
}
@@ -114,9 +114,9 @@ clear_cache(GLcontext *ctx, struct gl_program_cache *cache)
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 @@ _mesa_new_program_cache(void)
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 @@ void
_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 @@ _mesa_program_cache_insert(GLcontext *ctx,
c->hash = hash;
- c->key = _mesa_malloc(keysize);
+ c->key = malloc(keysize);
memcpy(c->key, key, keysize);
c->program = program; /* no refcount change */