summaryrefslogtreecommitdiff
path: root/lzfP.h
diff options
context:
space:
mode:
Diffstat (limited to 'lzfP.h')
-rw-r--r--lzfP.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/lzfP.h b/lzfP.h
index 48963b2..84c6028 100644
--- a/lzfP.h
+++ b/lzfP.h
@@ -46,19 +46,19 @@
#endif
/*
- * size of hashtable is (1 << HLOG) * sizeof (char *)
+ * Size of hashtable is (1 << HLOG) * sizeof (char *)
* decompression is independent of the hash table size
* the difference between 15 and 14 is very small
- * for small blocks (and 14 is usually a but faster).
+ * for small blocks (and 14 is usually a bit faster).
* For a low-memory/faster configuration, use HLOG == 13;
* For best compression, use 15 or 16 (or more).
*/
#ifndef HLOG
-# define HLOG 14
+# define HLOG 15
#endif
/*
- * sacrifice very little compression quality in favour of compression speed.
+ * Sacrifice very little compression quality in favour of compression speed.
* This gives almost the same compression as the default code, and is
* (very roughly) 15% faster. This is the preferable mode of operation.
*/
@@ -68,7 +68,7 @@
#endif
/*
- * sacrifice some more compression quality in favour of compression speed.
+ * Sacrifice some more compression quality in favour of compression speed.
* (roughly 1-2% worse compression for large blocks and
* 9-10% for small, redundant, blocks and >>20% better speed in both cases)
* In short: when in need for speed, enable this for binary data,
@@ -79,14 +79,14 @@
#endif
/*
- * unconditionally aligning does not cost very much, so do it if unsure
+ * Unconditionally aligning does not cost very much, so do it if unsure
*/
#ifndef STRICT_ALIGN
# define STRICT_ALIGN !(defined(__i386) || defined (__amd64))
#endif
/*
- * use string functions to copy memory.
+ * Use string functions to copy memory.
* this is usually a loss, even with glibc's optimized memcpy
*/
#ifndef USE_MEMCPY
@@ -94,7 +94,7 @@
#endif
/*
- * you may choose to pre-set the hash table (might be faster on some
+ * You may choose to pre-set the hash table (might be faster on some
* modern cpus and large (>>64k) blocks)
*/
#ifndef INIT_HTAB
@@ -102,7 +102,7 @@
#endif
/*
- * avoid assigning values to errno variable? for some embedding purposes
+ * Avoid assigning values to errno variable? for some embedding purposes
* (linux kernel for example), this is neccessary. NOTE: this breaks
* the documentation in lzf.h.
*/
@@ -119,6 +119,18 @@
# define LZF_STATE_ARG 0
#endif
+/*
+ * Wether to add extra checks for input validity in lzf_decompress
+ * and return EINVAL if the input stream has been corrupted. This
+ * only shields against overflowing the input buffer and will not
+ * detect most corrupted streams.
+ * This check is not normally noticable on modern hardware
+ * (<1% slowdown), but might slow down older cpus considerably.
+ */
+#ifndef CHECK_INPUT
+# define CHECK_INPUT 0
+#endif
+
/*****************************************************************************/
/* nothing should be changed below */