From: Eric Biggers Date: Thu, 12 Jun 2014 04:19:08 +0000 (-0500) Subject: {lzx,lzms-decompress.c}: Allocate context with DECODE_TABLE_ALIGNMENT X-Git-Tag: v1.7.0~40 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=500874ebbf2839d2c93db2b4094817c219946f29;hp=e3a7c6c725964662f4ad1fcfe21d2da742499b8a {lzx,lzms-decompress.c}: Allocate context with DECODE_TABLE_ALIGNMENT --- 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;