summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_context.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_context.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_context.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 66d0cf7759..7e7015defc 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -106,7 +106,7 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
}
}
- FREE( llvmpipe );
+ align_free( llvmpipe );
}
static unsigned int
@@ -143,11 +143,17 @@ llvmpipe_is_buffer_referenced( struct pipe_context *pipe,
struct pipe_context *
llvmpipe_create( struct pipe_screen *screen )
{
- struct llvmpipe_context *llvmpipe = CALLOC_STRUCT(llvmpipe_context);
+ struct llvmpipe_context *llvmpipe;
uint i;
+ llvmpipe = align_malloc(sizeof(struct llvmpipe_context), 16);
+ if (!llvmpipe)
+ return NULL;
+
util_init_math();
+ memset(llvmpipe, 0, sizeof *llvmpipe);
+
llvmpipe->pipe.winsys = screen->winsys;
llvmpipe->pipe.screen = screen;
llvmpipe->pipe.destroy = llvmpipe_destroy;