[intel] Use mesa texmemory functions to allocate teximage Data.
authorMichal Wajdeczko <Michal.Wajdeczko@intel.com>
Wed, 26 Mar 2008 20:33:34 +0000 (13:33 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 26 Mar 2008 20:33:34 +0000 (13:33 -0700)
Failure to consistently do so resulted in mismatched aligned versus
unaligned alloc/free.

src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/intel/intel_tex_image.c

index c110df478f250f80140f88af0dcf9d45e15c0adb..329af0d1b0471c487c77f31b6a7e007d2aec94b1 100644 (file)
@@ -1,5 +1,6 @@
 #include "swrast/swrast.h"
 #include "texobj.h"
+#include "teximage.h"
 #include "mipmap.h"
 #include "intel_context.h"
 #include "intel_mipmap_tree.h"
@@ -71,7 +72,7 @@ intelFreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
    }
 
    if (texImage->Data) {
-      free(texImage->Data);
+      _mesa_free_texmemory(texImage->Data);
       texImage->Data = NULL;
    }
 }
index 3d2fc243575806ca81d1de83050a664cdf984181..dd8fbeaa911e0673e19b03c0b28ecf76513ea313 100644 (file)
@@ -360,7 +360,8 @@ intelTexImage(GLcontext * ctx,
       assert(!texImage->Data);
    }
    else if (texImage->Data) {
-      _mesa_align_free(texImage->Data);
+      _mesa_free_texmemory(texImage->Data);
+      texImage->Data = NULL;
    }
 
    /* If this is the only texture image in the tree, could call
@@ -481,7 +482,7 @@ intelTexImage(GLcontext * ctx,
          sizeInBytes = depth * dstRowStride * postConvHeight;
       }
 
-      texImage->Data = malloc(sizeInBytes);
+      texImage->Data = _mesa_alloc_texmemory(sizeInBytes);
    }
 
    DBG("Upload image %dx%dx%d row_len %d "