summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_tile_cache.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-08-18 20:25:37 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:34 +0100
commita22f87c99462fd83dc398f4c06fc6d9997e15dba (patch)
tree27cfb130bbbdd4a5dca7536b50b2f0de46c2802a /src/gallium/drivers/llvmpipe/lp_tile_cache.c
parent49d83fdc4599256da9a33ed943009038859c34c5 (diff)
llvmpipe: use align_malloc for all structs containing ALIGN16 members
Unless the struct is allocated aligned, aligning the members isn't very helpful.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_cache.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
index 94908f601c..e2fb157c02 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c
+++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
@@ -88,8 +88,9 @@ lp_create_tile_cache( struct pipe_screen *screen )
struct llvmpipe_tile_cache *tc;
uint pos;
- tc = CALLOC_STRUCT( llvmpipe_tile_cache );
+ tc = align_malloc( sizeof(struct llvmpipe_tile_cache), 16 );
if (tc) {
+ memset(tc, 0, sizeof *tc);
tc->screen = screen;
for (pos = 0; pos < NUM_ENTRIES; pos++) {
tc->entries[pos].addr.bits.invalid = 1;
@@ -118,7 +119,7 @@ lp_destroy_tile_cache(struct llvmpipe_tile_cache *tc)
screen->tex_transfer_destroy(tc->tex_trans);
}
- FREE( tc );
+ align_free( tc );
}