]> wimlib.net Git - wimlib/blobdiff - src/xpress_compress.c
Get rid of matchfinder_common.h and manual memsets
[wimlib] / src / xpress_compress.c
index 1c824a57634520cdd3974e32ef88cfbe47cf7aa6..2f3a35e99b86db43a7adea6c95df140c90e3e08d 100644 (file)
@@ -1031,7 +1031,8 @@ xpress_get_compressor_size(size_t max_bufsize, unsigned compression_level)
 }
 
 static u64
-xpress_get_needed_memory(size_t max_bufsize, unsigned compression_level)
+xpress_get_needed_memory(size_t max_bufsize, unsigned compression_level,
+                        bool destructive)
 {
        u64 size = 0;
 
@@ -1060,15 +1061,14 @@ xpress_get_needed_memory(size_t max_bufsize, unsigned compression_level)
 
 static int
 xpress_create_compressor(size_t max_bufsize, unsigned compression_level,
-                        void **c_ret)
+                        bool destructive, void **c_ret)
 {
        struct xpress_compressor *c;
 
        if (max_bufsize > XPRESS_MAX_BUFSIZE)
                return WIMLIB_ERR_INVALID_PARAM;
 
-       c = ALIGNED_MALLOC(xpress_get_compressor_size(max_bufsize, compression_level),
-                          MATCHFINDER_ALIGNMENT);
+       c = MALLOC(xpress_get_compressor_size(max_bufsize, compression_level));
        if (!c)
                goto oom0;
 
@@ -1128,14 +1128,14 @@ xpress_create_compressor(size_t max_bufsize, unsigned compression_level,
        return 0;
 
 oom1:
-       ALIGNED_FREE(c);
+       FREE(c);
 oom0:
        return WIMLIB_ERR_NOMEM;
 }
 
 static size_t
-xpress_compress(const void *in, size_t in_nbytes,
-               void *out, size_t out_nbytes_avail, void *_c)
+xpress_compress(const void *restrict in, size_t in_nbytes,
+               void *restrict out, size_t out_nbytes_avail, void *restrict _c)
 {
        struct xpress_compressor *c = _c;
 
@@ -1163,7 +1163,7 @@ xpress_free_compressor(void *_c)
        } else
 #endif
                FREE(c->chosen_items);
-       ALIGNED_FREE(c);
+       FREE(c);
 }
 
 const struct compressor_ops xpress_compressor_ops = {