than 4 gigabytes are now never extracted as externally backed. This
works around a bug in Microsoft's "WOF" driver.
+ The '--enable-verify-compression' configure option has been removed. If
+ you want to verify a WIM file, use the 'wimverify' program.
+
Version 1.8.0:
Improved the LZX compressor. It is now 15-20% faster than before and
provides a slightly better compression ratio.
AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions])
fi
-AC_MSG_CHECKING([whether to include automatic compression verification])
-AC_ARG_ENABLE([verify_compression],
- AS_HELP_STRING([--enable-verify-compression],
- [verify all compression results (makes compression
- slower; intended for debugging only)]),
- [ENABLE_VERIFY_COMPRESSION=$enableval],
- [ENABLE_VERIFY_COMPRESSION=no])
-AC_MSG_RESULT([$ENABLE_VERIFY_COMPRESSION])
-if test "$ENABLE_VERIFY_COMPRESSION" = "yes"; then
- AC_DEFINE([ENABLE_VERIFY_COMPRESSION], [1], [Define to 1 to verify compression results])
-fi
-
AC_MSG_CHECKING([whether to include support for multi-threaded compression])
AC_ARG_ENABLE([multithreaded-compression],
AS_HELP_STRING([--disable-multithreaded-compression],
# include "config.h"
#endif
-#include <stdlib.h>
-#include <string.h>
-
#include "wimlib.h"
#include "wimlib/error.h"
#include "wimlib/compressor_ops.h"
void *compressed_data, size_t compressed_size_avail,
struct wimlib_compressor *c)
{
- size_t compressed_size;
-
if (unlikely(uncompressed_size == 0 || uncompressed_size > c->max_block_size))
return 0;
- compressed_size = c->ops->compress(uncompressed_data,
- uncompressed_size,
- compressed_data,
- compressed_size_avail,
- c->private);
-
- /* (Optional) Verify that we really get the same thing back when
- * decompressing. Should always be the case, unless there's a bug. */
-#ifdef ENABLE_VERIFY_COMPRESSION
- if (compressed_size != 0) {
- struct wimlib_decompressor *d;
- int res;
- u8 *buf;
-
- buf = MALLOC(uncompressed_size);
- if (!buf) {
- WARNING("Unable to verify results of %s compression "
- "(can't allocate buffer)",
- wimlib_get_compression_type_string(c->ctype));
- return 0;
- }
-
- res = wimlib_create_decompressor(c->ctype,
- c->max_block_size, &d);
- if (res) {
- WARNING("Unable to verify results of %s compression "
- "(can't create decompressor)",
- wimlib_get_compression_type_string(c->ctype));
- FREE(buf);
- return 0;
- }
-
- res = wimlib_decompress(compressed_data, compressed_size,
- buf, uncompressed_size, d);
- wimlib_free_decompressor(d);
- if (res) {
- ERROR("Failed to decompress our %s-compressed data",
- wimlib_get_compression_type_string(c->ctype));
- FREE(buf);
- abort();
- }
-
- res = memcmp(uncompressed_data, buf, uncompressed_size);
- FREE(buf);
-
- if (res) {
- ERROR("Our %s-compressed data did not decompress "
- "to original",
- wimlib_get_compression_type_string(c->ctype));
- abort();
- }
- }
-#endif /* ENABLE_VERIFY_COMPRESSION */
-
- return compressed_size;
+ return c->ops->compress(uncompressed_data, uncompressed_size,
+ compressed_data, compressed_size_avail,
+ c->private);
}
WIMLIBAPI void