From a22f87c99462fd83dc398f4c06fc6d9997e15dba Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 18 Aug 2009 20:25:37 +0100 Subject: llvmpipe: use align_malloc for all structs containing ALIGN16 members Unless the struct is allocated aligned, aligning the members isn't very helpful. --- src/gallium/drivers/llvmpipe/lp_context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/llvmpipe/lp_context.c') 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; -- cgit v1.2.3