summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-08-18 20:25:37 +0100
committerJosé Fonseca <[email protected]>2009-08-29 09:21:34 +0100
commita22f87c99462fd83dc398f4c06fc6d9997e15dba (patch)
tree27cfb130bbbdd4a5dca7536b50b2f0de46c2802a /src/gallium/drivers/llvmpipe/lp_setup.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_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 04ae644ff98..f06538c75f5 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -1358,7 +1358,7 @@ void setup_prepare( struct setup_context *setup )
void setup_destroy_context( struct setup_context *setup )
{
- FREE( setup );
+ align_free( setup );
}
@@ -1367,9 +1367,14 @@ void setup_destroy_context( struct setup_context *setup )
*/
struct setup_context *setup_create_context( struct llvmpipe_context *llvmpipe )
{
- struct setup_context *setup = CALLOC_STRUCT(setup_context);
+ struct setup_context *setup;
unsigned i;
+ setup = align_malloc(sizeof(struct setup_context), 16);
+ if (!setup)
+ return NULL;
+
+ memset(setup, 0, sizeof *setup);
setup->llvmpipe = llvmpipe;
for (i = 0; i < MAX_QUADS; i++) {