]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
make ZSTD_HASHLOG3_MAX private 2752/head
authorYann Collet <cyan@fb.com>
Fri, 20 Aug 2021 16:52:42 +0000 (09:52 -0700)
committerYann Collet <cyan@fb.com>
Fri, 20 Aug 2021 16:52:42 +0000 (09:52 -0700)
This is an implementation detail,
it doesn't belong to public space (zstd.h).

lib/compress/zstd_compress.c
lib/zstd.h

index 9910265fe40b5f1b83134e45a3798630df650e88..2f02d512cf299d2853b7585ddc80bf8d17ae4543 100644 (file)
 #  define ZSTD_COMPRESS_HEAPMODE 0
 #endif
 
+/*!
+ * ZSTD_HASHLOG3_MAX :
+ * Maximum size of the hash table dedicated to find 3-bytes matches,
+ * in log format, aka 17 => 1 << 17 == 128Ki positions.
+ * This structure is only used in zstd_opt.
+ * Since allocation is centralized for all strategies, it has to be known here.
+ * The actual (selected) size of the hash table is then stored in ZSTD_matchState_t.hashLog3,
+ * so that zstd_opt.c doesn't need to know about this constant.
+ */
+#ifndef ZSTD_HASHLOG3_MAX
+#  define ZSTD_HASHLOG3_MAX 17
+#endif
 
 /*-*************************************
 *  Helper functions
@@ -3732,9 +3744,9 @@ static size_t ZSTD_compressBlock_splitBlock(ZSTD_CCtx* zc,
 }
 
 /* ZSTD_convertBlockSequencesToSeqStore()
- * Converts an array of ZSTD_Sequence* with the corresponding original src buffer into 
+ * Converts an array of ZSTD_Sequence* with the corresponding original src buffer into
  * the seqStore of a cctx.
- * 
+ *
  * Returns 0 on success, ZSTD_error on failure.
  */
 static UNUSED_ATTR size_t ZSTD_convertBlockSequencesToSeqStore(ZSTD_CCtx* cctx,
index 054fb9a5af2cb8567c04a6ffef687970faf6192b..ebe2e04b5b76108253a09a17e983fe401edc5505 100644 (file)
@@ -1157,9 +1157,6 @@ ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
 #define ZSTD_SRCSIZEHINT_MIN        0
 #define ZSTD_SRCSIZEHINT_MAX        INT_MAX
 
-/* internal */
-#define ZSTD_HASHLOG3_MAX           17
-
 
 /* ---  Advanced types  --- */
 
@@ -2225,7 +2222,7 @@ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
  * This function is DEPRECATED, and equivalent to:
  *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);
  *     ZSTD_CCtx_refCDict(zcs, cdict);
- * 
+ *
  * note : cdict will just be referenced, and must outlive compression session
  * This prototype will generate compilation warnings.
  */