Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make ZSTD_HASHLOG3_MAX private #2752

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/compress/zstd_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
# 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
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions lib/zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 --- */

Expand Down Expand Up @@ -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.
*/
Expand Down