diff options
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index aa3fbbb15ef..f6ef4238646 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.2 1999/10/08 09:27:11 keithw Exp $ */ +/* $Id: teximage.c,v 1.3 1999/10/10 12:56:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -236,7 +236,7 @@ static GLint components_in_intformat( GLint format ) struct gl_texture_image *gl_alloc_texture_image( void ) { - return (struct gl_texture_image *) calloc( 1, sizeof(struct gl_texture_image) ); + return GL_CALLOC_STRUCT(gl_texture_image); } @@ -244,9 +244,9 @@ struct gl_texture_image *gl_alloc_texture_image( void ) void gl_free_texture_image( struct gl_texture_image *teximage ) { if (teximage->Data) { - free( teximage->Data ); + GL_FREE( teximage->Data ); } - free( teximage ); + GL_FREE( teximage ); } @@ -389,7 +389,7 @@ image_to_texture( GLcontext *ctx, const struct gl_image *image, texImage->Height2 = 1 << texImage->HeightLog2; texImage->Depth2 = 1 << texImage->DepthLog2; texImage->MaxLog2 = MAX2( texImage->WidthLog2, texImage->HeightLog2 ); - texImage->Data = (GLubyte *) malloc( numPixels * components + EXTRA_BYTE ); + texImage->Data = (GLubyte *) GL_ALLOC( numPixels * components + EXTRA_BYTE ); if (!texImage->Data) { /* out of memory */ @@ -872,7 +872,7 @@ make_null_texture( GLcontext *ctx, GLenum internalFormat, /* XXX should we really allocate memory for the image or let it be NULL? */ /*texImage->Data = NULL;*/ - texImage->Data = (GLubyte *) malloc( numPixels * components + EXTRA_BYTE ); + texImage->Data = (GLubyte *) GL_ALLOC( numPixels * components + EXTRA_BYTE ); /* * Let's see if anyone finds this. If glTexImage2D() is called with @@ -1882,7 +1882,7 @@ static struct gl_image *read_color_image( GLcontext *ctx, GLint x, GLint y, /* * Allocate image struct and image data buffer */ - image = (struct gl_image *) malloc( sizeof(struct gl_image) ); + image = GL_ALLOC_STRUCT( gl_image ); if (image) { image->Width = width; image->Height = height; @@ -1891,9 +1891,9 @@ static struct gl_image *read_color_image( GLcontext *ctx, GLint x, GLint y, image->Format = format; image->Type = GL_UNSIGNED_BYTE; image->RefCount = 0; - image->Data = (GLubyte *) malloc( width * height * components ); + image->Data = (GLubyte *) GL_ALLOC( width * height * components ); if (!image->Data) { - free(image); + GL_FREE(image); return NULL; } } |