summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-09-21 16:32:57 -0700
committerMatt Turner <[email protected]>2014-09-24 09:58:42 -0700
commit452926a5ec54e5700657d28b2cb8e46c4bbaa0a9 (patch)
treedcbd417d2ade077e18f25bf31afb4022138dc9a1 /src/mesa/main
parente5162defc8169a1d0a06e16c65c5f63b98923426 (diff)
mesa: Use realloc() instead of _mesa_realloc() and remove the latter.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/imports.c14
-rw-r--r--src/mesa/main/imports.h3
-rw-r--r--src/mesa/main/shaderapi.c5
3 files changed, 2 insertions, 20 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 4afe156b031..c5a7d63fb51 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -209,20 +209,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
#endif
}
-
-
-/** Reallocate memory */
-void *
-_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
-{
- const size_t copySize = (oldSize < newSize) ? oldSize : newSize;
- void *newBuffer = malloc(newSize);
- if (newBuffer && oldBuffer && copySize > 0)
- memcpy(newBuffer, oldBuffer, copySize);
- free(oldBuffer);
- return newBuffer;
-}
-
/*@}*/
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 59fd19c3647..8dbcf8302bc 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -473,9 +473,6 @@ _mesa_exec_malloc( GLuint size );
extern void
_mesa_exec_free( void *addr );
-extern void *
-_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
-
#ifndef FFS_DEFINED
#define FFS_DEFINED 1
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 620cab3cc0e..dc8b255d179 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -272,9 +272,8 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
/* grow list */
shProg->Shaders = (struct gl_shader **)
- _mesa_realloc(shProg->Shaders,
- n * sizeof(struct gl_shader *),
- (n + 1) * sizeof(struct gl_shader *));
+ realloc(shProg->Shaders,
+ (n + 1) * sizeof(struct gl_shader *));
if (!shProg->Shaders) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader");
return;