From 500874ebbf2839d2c93db2b4094817c219946f29 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 11 Jun 2014 23:19:08 -0500 Subject: [PATCH] {lzx,lzms-decompress.c}: Allocate context with DECODE_TABLE_ALIGNMENT --- src/lzms-decompress.c | 5 +++-- src/lzx-decompress.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lzms-decompress.c b/src/lzms-decompress.c index 2bc1c754..1ddc3f19 100644 --- a/src/lzms-decompress.c +++ b/src/lzms-decompress.c @@ -1032,7 +1032,7 @@ lzms_free_decompressor(void *_ctx) { struct lzms_decompressor *ctx = _ctx; - FREE(ctx); + ALIGNED_FREE(ctx); } static int @@ -1042,7 +1042,8 @@ lzms_create_decompressor(size_t max_block_size, { struct lzms_decompressor *ctx; - ctx = MALLOC(sizeof(struct lzms_decompressor)); + ctx = ALIGNED_MALLOC(sizeof(struct lzms_decompressor), + DECODE_TABLE_ALIGNMENT); if (ctx == NULL) return WIMLIB_ERR_NOMEM; diff --git a/src/lzx-decompress.c b/src/lzx-decompress.c index bbb10514..d259eeed 100644 --- a/src/lzx-decompress.c +++ b/src/lzx-decompress.c @@ -809,7 +809,7 @@ lzx_free_decompressor(void *_ctx) { struct lzx_decompressor *ctx = _ctx; - FREE(ctx); + ALIGNED_FREE(ctx); } static int @@ -822,7 +822,8 @@ lzx_create_decompressor(size_t max_window_size, if (!lzx_window_size_valid(max_window_size)) return WIMLIB_ERR_INVALID_PARAM; - ctx = MALLOC(sizeof(struct lzx_decompressor)); + ctx = ALIGNED_MALLOC(sizeof(struct lzx_decompressor), + DECODE_TABLE_ALIGNMENT); if (ctx == NULL) return WIMLIB_ERR_NOMEM; -- 2.43.0