{lzx,lzms-decompress.c}: Allocate context with DECODE_TABLE_ALIGNMENT
authorEric Biggers <ebiggers3@gmail.com>
Thu, 12 Jun 2014 04:19:08 +0000 (23:19 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 12 Jun 2014 04:20:24 +0000 (23:20 -0500)
src/lzms-decompress.c
src/lzx-decompress.c

index 2bc1c754cd69e49b86c17cce9e934ed888392cd4..1ddc3f19dfdce40e9b0bc8e8833505654fd95595 100644 (file)
@@ -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;
 
index bbb105144710464068c33a9eeaabdb41ea452c05..d259eeedc38ae31b6c7156fc0b1599f3b2af8d90 100644 (file)
@@ -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;