Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index bdd26b7..03ff30a 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -85,7 +85,7 @@
    }
 
    if (program->Base.String != NULL)
-      _mesa_free(program->Base.String);
+      free(program->Base.String);
 
    /* Copy the relevant contents of the arb_program struct into the
     * fragment_program struct.
@@ -130,7 +130,7 @@
       program->Base.InputsRead |= FRAG_BIT_FOGC;
 
    if (program->Base.Instructions)
-      _mesa_free(program->Base.Instructions);
+      free(program->Base.Instructions);
    program->Base.Instructions = prog.Instructions;
 
    if (program->Base.Parameters)
@@ -181,7 +181,7 @@
    }
 
    if (program->Base.String != NULL)
-      _mesa_free(program->Base.String);
+      free(program->Base.String);
 
    /* Copy the relevant contents of the arb_program struct into the 
     * vertex_program struct.
@@ -203,7 +203,7 @@
       ? GL_TRUE : GL_FALSE;
 
    if (program->Base.Instructions)
-      _mesa_free(program->Base.Instructions);
+      free(program->Base.Instructions);
    program->Base.Instructions = prog.Instructions;
 
    if (program->Base.Parameters)
diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c
index fb2fa4b..870f77e 100644
--- a/src/mesa/shader/atifragshader.c
+++ b/src/mesa/shader/atifragshader.c
@@ -60,11 +60,11 @@
    GLuint i;
    for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
       if (s->Instructions[i])
-         _mesa_free(s->Instructions[i]);
+         free(s->Instructions[i]);
       if (s->SetupInst[i])
-         _mesa_free(s->SetupInst[i]);
+         free(s->SetupInst[i]);
    }
-   _mesa_free(s);
+   free(s);
 }
 
 
@@ -293,7 +293,7 @@
       if (prog) {
 	 prog->RefCount--;
 	 if (prog->RefCount <= 0) {
-	    _mesa_free(prog);
+	    free(prog);
 	 }
       }
    }
@@ -318,9 +318,9 @@
    /* no idea if it's allowed to redefine a shader */
    for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
          if (ctx->ATIFragmentShader.Current->Instructions[i])
-            _mesa_free(ctx->ATIFragmentShader.Current->Instructions[i]);
+            free(ctx->ATIFragmentShader.Current->Instructions[i]);
          if (ctx->ATIFragmentShader.Current->SetupInst[i])
-            _mesa_free(ctx->ATIFragmentShader.Current->SetupInst[i]);
+            free(ctx->ATIFragmentShader.Current->SetupInst[i]);
    }
 
    /* malloc the instructions here - not sure if the best place but its
@@ -328,11 +328,11 @@
    for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
       ctx->ATIFragmentShader.Current->Instructions[i] =
 	 (struct atifs_instruction *)
-	 _mesa_calloc(sizeof(struct atifs_instruction) *
+	 calloc(1, sizeof(struct atifs_instruction) *
 		   (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI));
       ctx->ATIFragmentShader.Current->SetupInst[i] =
 	 (struct atifs_setupinst *)
-	 _mesa_calloc(sizeof(struct atifs_setupinst) *
+	 calloc(1, sizeof(struct atifs_setupinst) *
 		   (MAX_NUM_FRAGMENT_REGISTERS_ATI));
    }
 
diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c
index e89a256..fa6ba2b 100644
--- a/src/mesa/shader/hash_table.c
+++ b/src/mesa/shader/hash_table.c
@@ -65,7 +65,7 @@
         num_buckets = 16;
     }
 
-    ht = _mesa_malloc(sizeof(*ht) + ((num_buckets - 1) 
+    ht = malloc(sizeof(*ht) + ((num_buckets - 1) 
 				     * sizeof(ht->buckets[0])));
     if (ht != NULL) {
         ht->hash = hash;
@@ -85,7 +85,7 @@
 hash_table_dtor(struct hash_table *ht)
 {
    hash_table_clear(ht);
-   _mesa_free(ht);
+   free(ht);
 }
 
 
@@ -100,7 +100,7 @@
    for (i = 0; i < ht->num_buckets; i++) {
       foreach_s(node, temp, & ht->buckets[i]) {
 	 remove_from_list(node);
-	 _mesa_free(node);
+	 free(node);
       }
 
       assert(is_empty_list(& ht->buckets[i]));
@@ -134,7 +134,7 @@
     const unsigned bucket = hash_value % ht->num_buckets;
     struct hash_node *node;
 
-    node = _mesa_calloc(sizeof(*node));
+    node = calloc(1, sizeof(*node));
 
     node->data = data;
     node->key = key;
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 639408d..4f02703 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -171,7 +171,7 @@
    _mesa_debug(parseState->ctx,
                "nvfragparse.c(%d): line %d, column %d:%s (%s)\n",
                lineNo, line, column, (char *) lineStr, msg);
-   _mesa_free((void *) lineStr);
+   free((void *) lineStr);
 #else
    (void) lineNo;
 #endif
@@ -1231,7 +1231,7 @@
    for (len = 0; str[len] != '\''; len++) /* find closing quote */
       ;
    parseState->pos += len + 1;
-   msg = (GLubyte*) _mesa_malloc(len + 1);
+   msg = (GLubyte*) malloc(len + 1);
 
    memcpy(msg, str, len);
    msg[len] = 0;
@@ -1548,7 +1548,7 @@
       program->Base.String = programString;
       program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
       if (program->Base.Instructions) {
-         _mesa_free(program->Base.Instructions);
+         free(program->Base.Instructions);
       }
       program->Base.Instructions = newInst;
       program->Base.NumInstructions = parseState.numInst;
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index 3656438..fb36303 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -82,7 +82,7 @@
    _mesa_debug(parseState->ctx,
                "nvfragparse.c(%d): line %d, column %d:%s (%s)\n",
                lineNo, line, column, (char *) lineStr, msg);
-   _mesa_free((void *) lineStr);
+   free((void *) lineStr);
 #else
    (void) lineNo;
 #endif
@@ -1048,7 +1048,7 @@
    for (len = 0; str[len] != '\''; len++) /* find closing quote */
       ;
    parseState->pos += len + 1;
-   msg = (GLubyte*) _mesa_malloc(len + 1);
+   msg = (GLubyte*) malloc(len + 1);
 
    memcpy(msg, str, len);
    msg[len] = 0;
@@ -1372,7 +1372,7 @@
       newInst = _mesa_alloc_instructions(parseState.numInst);
       if (!newInst) {
          _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
-         _mesa_free(programString);
+         free(programString);
          return;  /* out of memory */
       }
       _mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
@@ -1380,12 +1380,12 @@
       /* install the program */
       program->Base.Target = target;
       if (program->Base.String) {
-         _mesa_free(program->Base.String);
+         free(program->Base.String);
       }
       program->Base.String = programString;
       program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
       if (program->Base.Instructions) {
-         _mesa_free(program->Base.Instructions);
+         free(program->Base.Instructions);
       }
       program->Base.Instructions = newInst;
       program->Base.InputsRead = parseState.inputsRead;
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 */
diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c
index 0c4da4d..81099cb 100644
--- a/src/mesa/shader/prog_instruction.c
+++ b/src/mesa/shader/prog_instruction.c
@@ -70,7 +70,7 @@
 _mesa_alloc_instructions(GLuint numInst)
 {
    return (struct prog_instruction *)
-      _mesa_calloc(numInst * sizeof(struct prog_instruction));
+      calloc(1, numInst * sizeof(struct prog_instruction));
 }
 
 
@@ -128,11 +128,11 @@
    GLuint i;
    for (i = 0; i < count; i++) {
       if (inst[i].Data)
-         _mesa_free(inst[i].Data);
+         free(inst[i].Data);
       if (inst[i].Comment)
-         _mesa_free((char *) inst[i].Comment);
+         free((char *) inst[i].Comment);
    }
-   _mesa_free(inst);
+   free(inst);
 }
 
 
diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c
index e1ec522..09816d5 100644
--- a/src/mesa/shader/prog_optimize.c
+++ b/src/mesa/shader/prog_optimize.c
@@ -237,7 +237,7 @@
    }
 
    removeInst = (GLboolean *)
-      _mesa_calloc(prog->NumInstructions * sizeof(GLboolean));
+      calloc(1, prog->NumInstructions * sizeof(GLboolean));
 
    /* Determine which temps are read and written */
    for (i = 0; i < prog->NumInstructions; i++) {
@@ -347,7 +347,7 @@
    }
 
 done:
-   _mesa_free(removeInst);
+   free(removeInst);
 }
 
 
@@ -538,7 +538,7 @@
    }
 
    removeInst = (GLboolean *)
-      _mesa_calloc(prog->NumInstructions * sizeof(GLboolean));
+      calloc(1, prog->NumInstructions * sizeof(GLboolean));
 
    /*
     * Look for sequences such as this:
@@ -621,7 +621,7 @@
    /* now remove the instructions which aren't needed */
    rem = remove_instructions(prog, removeInst);
 
-   _mesa_free(removeInst);
+   free(removeInst);
 
    if (dbg) {
       _mesa_printf("Optimize: End remove extra moves.  %u instructions removed\n", rem);
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 1feb7bd..25bb4f3 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -54,16 +54,16 @@
 
       /* alloc arrays */
       p->Parameters = (struct gl_program_parameter *)
-	 _mesa_calloc(size * sizeof(struct gl_program_parameter));
+	 calloc(1, size * sizeof(struct gl_program_parameter));
 
       p->ParameterValues = (GLfloat (*)[4])
          _mesa_align_malloc(size * 4 *sizeof(GLfloat), 16);
 
 
       if ((p->Parameters == NULL) || (p->ParameterValues == NULL)) {
-	 _mesa_free(p->Parameters);
+	 free(p->Parameters);
 	 _mesa_align_free(p->ParameterValues);
-	 _mesa_free(p);
+	 free(p);
 	 p = NULL;
       }
    }
@@ -81,12 +81,12 @@
    GLuint i;
    for (i = 0; i < paramList->NumParameters; i++) {
       if (paramList->Parameters[i].Name)
-	 _mesa_free((void *) paramList->Parameters[i].Name);
+	 free((void *) paramList->Parameters[i].Name);
    }
-   _mesa_free(paramList->Parameters);
+   free(paramList->Parameters);
    if (paramList->ParameterValues)
       _mesa_align_free(paramList->ParameterValues);
-   _mesa_free(paramList);
+   free(paramList);
 }
 
 
@@ -486,7 +486,7 @@
    paramList->StateFlags |= _mesa_program_state_flags(stateTokens);
 
    /* free name string here since we duplicated it in add_parameter() */
-   _mesa_free(name);
+   free(name);
 
    return index;
 }
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 54fd88a..b238537 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -309,7 +309,7 @@
                = prog->Parameters->Parameters + index;
             char *state = _mesa_program_state_string(param->StateIndexes);
             _mesa_sprintf(str, state);
-            _mesa_free(state);
+            free(state);
          }
          break;
       case PROGRAM_ADDRESS:
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index f5264fa..2c84449 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -957,7 +957,7 @@
 /**
  * Make a string from the given state vector.
  * For example, return "state.matrix.texture[2].inverse".
- * Use _mesa_free() to deallocate the string.
+ * Use free() to deallocate the string.
  */
 char *
 _mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c
index a831ce8..c408a84 100644
--- a/src/mesa/shader/prog_uniform.c
+++ b/src/mesa/shader/prog_uniform.c
@@ -45,10 +45,10 @@
 {
    GLuint i;
    for (i = 0; i < list->NumUniforms; i++) {
-      _mesa_free((void *) list->Uniforms[i].Name);
+      free((void *) list->Uniforms[i].Name);
    }
-   _mesa_free(list->Uniforms);
-   _mesa_free(list);
+   free(list->Uniforms);
+   free(list);
 }
 
 
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 0c3c5ff..f4f701b 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -127,11 +127,11 @@
    if (ctx->ATIFragmentShader.Current) {
       ctx->ATIFragmentShader.Current->RefCount--;
       if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
-         _mesa_free(ctx->ATIFragmentShader.Current);
+         free(ctx->ATIFragmentShader.Current);
       }
    }
 #endif
-   _mesa_free((void *) ctx->Program.ErrorString);
+   free((void *) ctx->Program.ErrorString);
 }
 
 
@@ -162,7 +162,7 @@
    if (ctx->ATIFragmentShader.Current) {
       ctx->ATIFragmentShader.Current->RefCount--;
       if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
-         _mesa_free(ctx->ATIFragmentShader.Current);
+         free(ctx->ATIFragmentShader.Current);
       }
    }
    ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader;
@@ -180,7 +180,7 @@
 _mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string)
 {
    ctx->Program.ErrorPos = pos;
-   _mesa_free((void *) ctx->Program.ErrorString);
+   free((void *) ctx->Program.ErrorString);
    if (!string)
       string = "";
    ctx->Program.ErrorString = _mesa_strdup(string);
@@ -190,7 +190,7 @@
 /**
  * Find the line number and column for 'pos' within 'string'.
  * Return a copy of the line which contains 'pos'.  Free the line with
- * _mesa_free().
+ * free().
  * \param string  the program string
  * \param pos     the position within the string
  * \param line    returns the line number corresponding to 'pos'.
@@ -222,7 +222,7 @@
    while (*p != 0 && *p != '\n')
       p++;
    len = p - lineStart;
-   s = (GLubyte *) _mesa_malloc(len + 1);
+   s = (GLubyte *) malloc(len + 1);
    memcpy(s, lineStart, len);
    s[len] = 0;
 
@@ -337,7 +337,7 @@
       return;
 
    if (prog->String)
-      _mesa_free(prog->String);
+      free(prog->String);
 
    _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
 
@@ -351,7 +351,7 @@
       _mesa_free_parameter_list(prog->Attributes);
    }
 
-   _mesa_free(prog);
+   free(prog);
 }
 
 
diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c
index 182ef4c..e5ef25e 100644
--- a/src/mesa/shader/program_parse.tab.c
+++ b/src/mesa/shader/program_parse.tab.c
@@ -3140,7 +3140,7 @@
 		      ? err_str : "invalid condition code");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -3166,7 +3166,7 @@
 		      ? err_str : "invalid condition code");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -4547,7 +4547,7 @@
 		      ? err_str : "invalid storage size specifier");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -5403,7 +5403,7 @@
    param_list->StateFlags |= _mesa_program_state_flags(tokens);
 
    /* free name string here since we duplicated it in add_parameter() */
-   _mesa_free(name);
+   free(name);
 
    return index;
 }
@@ -5568,7 +5568,7 @@
     */
    length = 1 + vsnprintf(NULL, 0, fmt, args);
 
-   str = _mesa_malloc(length);
+   str = malloc(length);
    if (str) {
       vsnprintf(str, length, fmt, args);
    }
@@ -5588,7 +5588,7 @@
    err_str = make_error_string("glProgramStringARB(%s)\n", s);
    if (err_str) {
       _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str);
-      _mesa_free(err_str);
+      free(err_str);
    }
 
    err_str = make_error_string("line %u, char %u: error: %s\n",
@@ -5596,7 +5596,7 @@
    _mesa_set_program_error(state->ctx, locp->position, err_str);
 
    if (err_str) {
-      _mesa_free(err_str);
+      free(err_str);
    }
 }
 
@@ -5618,7 +5618,7 @@
 
    /* Make a copy of the program string and force it to be NUL-terminated.
     */
-   strz = (GLubyte *) _mesa_malloc(len + 1);
+   strz = (GLubyte *) malloc(len + 1);
    if (strz == NULL) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
       return GL_FALSE;
@@ -5706,7 +5706,7 @@
 error:
    for (inst = state->inst_head; inst != NULL; inst = temp) {
       temp = inst->next;
-      _mesa_free(inst);
+      free(inst);
    }
 
    state->inst_head = NULL;
@@ -5715,8 +5715,8 @@
    for (sym = state->sym; sym != NULL; sym = temp) {
       temp = sym->next;
 
-      _mesa_free((void *) sym->name);
-      _mesa_free(sym);
+      free((void *) sym->name);
+      free(sym);
    }
    state->sym = NULL;
 
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 577bd2c..299e247 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -1056,7 +1056,7 @@
 		      ? err_str : "invalid condition code");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -1079,7 +1079,7 @@
 		      ? err_str : "invalid condition code");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -1956,7 +1956,7 @@
 		      ? err_str : "invalid storage size specifier");
 
 	      if (err_str != NULL) {
-		 _mesa_free(err_str);
+		 free(err_str);
 	      }
 
 	      YYERROR;
@@ -2442,7 +2442,7 @@
    param_list->StateFlags |= _mesa_program_state_flags(tokens);
 
    /* free name string here since we duplicated it in add_parameter() */
-   _mesa_free(name);
+   free(name);
 
    return index;
 }
@@ -2607,7 +2607,7 @@
     */
    length = 1 + vsnprintf(NULL, 0, fmt, args);
 
-   str = _mesa_malloc(length);
+   str = malloc(length);
    if (str) {
       vsnprintf(str, length, fmt, args);
    }
@@ -2627,7 +2627,7 @@
    err_str = make_error_string("glProgramStringARB(%s)\n", s);
    if (err_str) {
       _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str);
-      _mesa_free(err_str);
+      free(err_str);
    }
 
    err_str = make_error_string("line %u, char %u: error: %s\n",
@@ -2635,7 +2635,7 @@
    _mesa_set_program_error(state->ctx, locp->position, err_str);
 
    if (err_str) {
-      _mesa_free(err_str);
+      free(err_str);
    }
 }
 
@@ -2657,7 +2657,7 @@
 
    /* Make a copy of the program string and force it to be NUL-terminated.
     */
-   strz = (GLubyte *) _mesa_malloc(len + 1);
+   strz = (GLubyte *) malloc(len + 1);
    if (strz == NULL) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
       return GL_FALSE;
@@ -2745,7 +2745,7 @@
 error:
    for (inst = state->inst_head; inst != NULL; inst = temp) {
       temp = inst->next;
-      _mesa_free(inst);
+      free(inst);
    }
 
    state->inst_head = NULL;
@@ -2754,8 +2754,8 @@
    for (sym = state->sym; sym != NULL; sym = temp) {
       temp = sym->next;
 
-      _mesa_free((void *) sym->name);
-      _mesa_free(sym);
+      free((void *) sym->name);
+      free(sym);
    }
    state->sym = NULL;
 
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 7e2a60f..ad3ff26 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -115,12 +115,12 @@
    shProg->NumShaders = 0;
 
    if (shProg->Shaders) {
-      _mesa_free(shProg->Shaders);
+      free(shProg->Shaders);
       shProg->Shaders = NULL;
    }
 
    if (shProg->InfoLog) {
-      _mesa_free(shProg->InfoLog);
+      free(shProg->InfoLog);
       shProg->InfoLog = NULL;
    }
 }
@@ -134,7 +134,7 @@
 {
    _mesa_free_shader_program_data(ctx, shProg);
 
-   _mesa_free(shProg);
+   free(shProg);
 }
 
 
@@ -262,11 +262,11 @@
 _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh)
 {
    if (sh->Source)
-      _mesa_free((void *) sh->Source);
+      free((void *) sh->Source);
    if (sh->InfoLog)
-      _mesa_free(sh->InfoLog);
+      free(sh->InfoLog);
    _mesa_reference_program(ctx, &sh->Program, NULL);
-   _mesa_free(sh);
+   free(sh);
 }
 
 
@@ -709,7 +709,7 @@
 
          /* alloc new, smaller array */
          newList = (struct gl_shader **)
-            _mesa_malloc((n - 1) * sizeof(struct gl_shader *));
+            malloc((n - 1) * sizeof(struct gl_shader *));
          if (!newList) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader");
             return;
@@ -719,7 +719,7 @@
          }
          while (++i < n)
             newList[j++] = shProg->Shaders[i];
-         _mesa_free(shProg->Shaders);
+         free(shProg->Shaders);
 
          shProg->Shaders = newList;
          shProg->NumShaders = n - 1;
@@ -1377,7 +1377,7 @@
       if (c) {
          /* truncate name at [ */
          const GLint len = c - name;
-         GLchar *newName = _mesa_malloc(len + 1);
+         GLchar *newName = malloc(len + 1);
          if (!newName)
             return -1; /* out of mem */
          memcpy(newName, name, len);
@@ -1400,7 +1400,7 @@
             }
          }
 
-         _mesa_free(newName);
+         free(newName);
       }
    }
 
@@ -1431,7 +1431,7 @@
 
    /* free old shader source string and install new one */
    if (sh->Source) {
-      _mesa_free((void *) sh->Source);
+      free((void *) sh->Source);
    }
    sh->Source = source;
    sh->CompileStatus = GL_FALSE;
@@ -2155,7 +2155,7 @@
    if (!shProg->Validated) {
       /* update info log */
       if (shProg->InfoLog) {
-         _mesa_free(shProg->InfoLog);
+         free(shProg->InfoLog);
       }
       shProg->InfoLog = _mesa_strdup(errMsg);
    }
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 2280ceb..6901b93 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -3639,7 +3639,7 @@
    assert(initializer->type == SLANG_OPER_CALL);
    assert(initializer->array_constructor);
 
-   values = (GLfloat *) _mesa_malloc(numElements * 4 * sizeof(GLfloat));
+   values = (GLfloat *) malloc(numElements * 4 * sizeof(GLfloat));
 
    /* convert constructor params into ordinary floats */
    for (i = 0; i < numElements; i++) {
@@ -3670,7 +3670,7 @@
    }
    assert(var->store->Size == size);
 
-   _mesa_free(values);
+   free(values);
 
    return GL_TRUE;
 }
@@ -5321,7 +5321,7 @@
 
    /* free codegen context */
    /*
-   _mesa_free(A->codegen);
+   free(A->codegen);
    */
 
    return success;
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 41d51cd..4280698 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2948,7 +2948,7 @@
 
    /* free shader's prev info log */
    if (shader->InfoLog) {
-      _mesa_free(shader->InfoLog);
+      free(shader->InfoLog);
       shader->InfoLog = NULL;
    }
 
diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c
index eab9127..23c08a9 100644
--- a/src/mesa/shader/slang/slang_compile_variable.c
+++ b/src/mesa/shader/slang/slang_compile_variable.c
@@ -182,7 +182,7 @@
    }
 #if 0
    if (var->aux) {
-      _mesa_free(var->aux);
+      free(var->aux);
    }
 #endif
 }
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index b621e89..8bd699f 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -2528,7 +2528,7 @@
    GLuint *subroutineLoc, i, total;
 
    subroutineLoc
-      = (GLuint *) _mesa_malloc(emitInfo->NumSubroutines * sizeof(GLuint));
+      = (GLuint *) malloc(emitInfo->NumSubroutines * sizeof(GLuint));
 
    /* total number of instructions */
    total = mainP->NumInstructions;
@@ -2566,7 +2566,7 @@
 
    /* free subroutine list */
    if (emitInfo->Subroutines) {
-      _mesa_free(emitInfo->Subroutines);
+      free(emitInfo->Subroutines);
       emitInfo->Subroutines = NULL;
    }
    emitInfo->NumSubroutines = 0;
@@ -2585,7 +2585,7 @@
       }
    }
 
-   _mesa_free(subroutineLoc);
+   free(subroutineLoc);
 }
 
 
diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c
index 1240621..7e00b57 100644
--- a/src/mesa/shader/slang/slang_label.c
+++ b/src/mesa/shader/slang/slang_label.c
@@ -34,7 +34,7 @@
    if (l) {
       l->Name = (char *) _slang_alloc(strlen(name) + 10);
       if (!l->Name) {
-         _mesa_free(l);
+         free(l);
          return NULL;
       }
       _mesa_sprintf(l->Name, "%s_%d", name, id);
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 68129d4..89658c1 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -68,7 +68,7 @@
 link_error(struct gl_shader_program *shProg, const char *msg)
 {
    if (shProg->InfoLog) {
-      _mesa_free(shProg->InfoLog);
+      free(shProg->InfoLog);
    }
    shProg->InfoLog = _mesa_strdup(msg);
    shProg->LinkStatus = GL_FALSE;
@@ -103,7 +103,7 @@
    GLuint *map, i, firstVarying, newFile;
    GLbitfield *inOutFlags;
 
-   map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint));
+   map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint));
    if (!map)
       return GL_FALSE;
 
@@ -134,7 +134,7 @@
             &shProg->Varying->Parameters[j];
          if (var->Size != v->Size) {
             link_error(shProg, "mismatched varying variable types");
-            _mesa_free(map);
+            free(map);
             return GL_FALSE;
          }
          if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) {
@@ -142,7 +142,7 @@
             _mesa_snprintf(msg, sizeof(msg),
                            "centroid modifier mismatch for '%s'", var->Name);
             link_error(shProg, msg);
-            _mesa_free(map);
+            free(map);
             return GL_FALSE;
          }
          if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) {
@@ -150,7 +150,7 @@
             _mesa_snprintf(msg, sizeof(msg),
                            "invariant modifier mismatch for '%s'", var->Name);
             link_error(shProg, msg);
-            _mesa_free(map);
+            free(map);
             return GL_FALSE;
          }
       }
@@ -162,7 +162,7 @@
 
       if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) {
          link_error(shProg, "Too many varying variables");
-         _mesa_free(map);
+         free(map);
          return GL_FALSE;
       }
 
@@ -202,7 +202,7 @@
       }
    }
 
-   _mesa_free(map);
+   free(map);
 
    /* these will get recomputed before linking is completed */
    prog->InputsRead = 0x0;
@@ -594,7 +594,7 @@
    GLuint totalLen = 0, len = 0;
    GLuint i;
 
-   shaderLengths = (GLuint *)_mesa_malloc(shProg->NumShaders * sizeof(GLuint));
+   shaderLengths = (GLuint *)malloc(shProg->NumShaders * sizeof(GLuint));
    if (!shaderLengths) {
       return NULL;
    }
@@ -611,13 +611,13 @@
    }
 
    if (totalLen == 0) {
-      _mesa_free(shaderLengths);
+      free(shaderLengths);
       return NULL;
    }
 
-   source = (GLchar *) _mesa_malloc(totalLen + 1);
+   source = (GLchar *) malloc(totalLen + 1);
    if (!source) {
-      _mesa_free(shaderLengths);
+      free(shaderLengths);
       return NULL;
    }
 
@@ -634,13 +634,13 @@
    _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source);
    */
 
-   _mesa_free(shaderLengths);
+   free(shaderLengths);
 
    remove_extra_version_directives(source);
 
    newShader = CALLOC_STRUCT(gl_shader);
    if (!newShader) {
-      _mesa_free(source);
+      free(source);
       return NULL;
    }
 
diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c
index 4f6b854..23917fb 100644
--- a/src/mesa/shader/slang/slang_log.c
+++ b/src/mesa/shader/slang/slang_log.c
@@ -43,7 +43,7 @@
 slang_info_log_destruct(slang_info_log * log)
 {
    if (!log->dont_free_text)
-      _mesa_free(log->text);
+      free(log->text);
 }
 
 static int
@@ -63,7 +63,7 @@
 	 _mesa_realloc(log->text, old_len + 1, old_len + size);
    }
    else {
-      log->text = (char *) (_mesa_malloc(size));
+      log->text = (char *) (malloc(size));
       if (log->text != NULL)
          log->text[0] = '\0';
    }
diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c
index 54f5196..5eaa7c4 100644
--- a/src/mesa/shader/slang/slang_mem.c
+++ b/src/mesa/shader/slang/slang_mem.c
@@ -56,12 +56,12 @@
 slang_mempool *
 _slang_new_mempool(GLuint initialSize)
 {
-   slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool));
+   slang_mempool *pool = (slang_mempool *) calloc(1, sizeof(slang_mempool));
    if (pool) {
-      pool->Data = (char *) _mesa_calloc(initialSize);
+      pool->Data = (char *) calloc(1, initialSize);
       /*printf("ALLOC MEMPOOL %d at %p\n", initialSize, pool->Data);*/
       if (!pool->Data) {
-         _mesa_free(pool);
+         free(pool);
          return NULL;
       }
       pool->Size = initialSize;
@@ -82,8 +82,8 @@
              pool->Used, pool->Size, pool->Count, pool->Largest);
       */
       total += pool->Used;
-      _mesa_free(pool->Data);
-      _mesa_free(pool);
+      free(pool->Data);
+      free(pool);
       pool = next;
    }
    /*printf("TOTAL ALLOCATED: %u\n", total);*/
@@ -125,7 +125,7 @@
 _slang_alloc(GLuint bytes)
 {
 #if USE_MALLOC_FREE
-   return _mesa_calloc(bytes);
+   return calloc(1, bytes);
 #else
    slang_mempool *pool;
    GET_CURRENT_CONTEXT(ctx);
@@ -231,7 +231,7 @@
 _slang_free(void *addr)
 {
 #if USE_MALLOC_FREE
-   _mesa_free(addr);
+   free(addr);
 #else
    if (addr) {
       GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c
index 56a33e6..dc1e196 100644
--- a/src/mesa/shader/slang/slang_utility.c
+++ b/src/mesa/shader/slang/slang_utility.c
@@ -54,7 +54,7 @@
 slang_string_free (slang_string *self)
 {
    if (self->data != NULL)
-      _mesa_free (self->data);
+      free(self->data);
 }
 
 GLvoid
diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c
index 1f6d9b8..6a5d686 100644
--- a/src/mesa/shader/symbol_table.c
+++ b/src/mesa/shader/symbol_table.c
@@ -354,7 +354,7 @@
 
    for (hdr = table->hdr; hdr != NULL; hdr = next) {
        next = hdr->next;
-       _mesa_free(hdr);
+       free(hdr);
    }
 
    hash_table_dtor(table->ht);