summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_label.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-04-21 12:29:46 -0600
committerBrian <brian@yutani.localnet.net>2007-04-21 12:30:58 -0600
commite261d66d81d47c4a2380ffcb7b39164b8e191168 (patch)
tree311b36ca6bd99a64ebdc88fb444cd19714988e56 /src/mesa/shader/slang/slang_label.c
parentcd3e39340f057712fcf02a35dff85645e475053a (diff)
Remove all the USE_MEMPOOL debug code.
Diffstat (limited to 'src/mesa/shader/slang/slang_label.c')
-rw-r--r--src/mesa/shader/slang/slang_label.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c
index a4529be74f..1ca1ef0c7c 100644
--- a/src/mesa/shader/slang/slang_label.c
+++ b/src/mesa/shader/slang/slang_label.c
@@ -15,17 +15,9 @@
slang_label *
_slang_label_new(const char *name)
{
-#if !USE_MEMPOOL
- slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label));
-#else
slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label));
-#endif
if (l) {
-#if !USE_MEMPOOL
- l->Name = _mesa_strdup(name);
-#else
l->Name = _slang_strdup(name);
-#endif
l->Location = -1;
}
return l;
@@ -38,17 +30,9 @@ slang_label *
_slang_label_new_unique(const char *name)
{
static int id = 1;
-#if !USE_MEMPOOL
- slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label));
-#else
slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label));
-#endif
if (l) {
-#if !USE_MEMPOOL
- l->Name = (char *) _mesa_malloc(_mesa_strlen(name) + 10);
-#else
l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10);
-#endif
if (!l->Name) {
_mesa_free(l);
return NULL;
@@ -63,13 +47,15 @@ _slang_label_new_unique(const char *name)
void
_slang_label_delete(slang_label *l)
{
-#if !USE_MEMPOOL
- if (l->Name)
- _mesa_free(l->Name);
- if (l->References)
- _mesa_free(l->References);
- _mesa_free(l);
-#endif
+ if (l->Name) {
+ _slang_free(l->Name);
+ l->Name = NULL;
+ }
+ if (l->References) {
+ _slang_free(l->References);
+ l->References = NULL;
+ }
+ _slang_free(l);
}
@@ -78,13 +64,8 @@ _slang_label_add_reference(slang_label *l, GLuint inst)
{
const GLuint oldSize = l->NumReferences * sizeof(GLuint);
assert(l->Location < 0);
-#if !USE_MEMPOOL
- l->References = _mesa_realloc(l->References,
- oldSize, oldSize + sizeof(GLuint));
-#else
l->References = _slang_realloc(l->References,
oldSize, oldSize + sizeof(GLuint));
-#endif
if (l->References) {
l->References[l->NumReferences] = inst;
l->NumReferences++;
@@ -117,9 +98,7 @@ _slang_label_set_location(slang_label *l, GLint location,
}
if (l->References) {
-#if !USE_MEMPOOL
- _mesa_free(l->References);
-#endif
+ _slang_free(l->References);
l->References = NULL;
}
}