diff options
author | Keith Whitwell <[email protected]> | 2009-08-18 20:25:37 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-08-29 09:21:34 +0100 |
commit | a22f87c99462fd83dc398f4c06fc6d9997e15dba (patch) | |
tree | 27cfb130bbbdd4a5dca7536b50b2f0de46c2802a /src/gallium/drivers/llvmpipe/lp_context.c | |
parent | 49d83fdc4599256da9a33ed943009038859c34c5 (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.c | 10 |
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 66d0cf77592..7e7015defc5 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; |