Skip to content

Commit

Permalink
Merge pull request facebook#2778 from senhuang42/opt_inlining_revert
Browse files Browse the repository at this point in the history
Revert opt outlining change
  • Loading branch information
senhuang42 committed Sep 15, 2021
2 parents 2fabd37 + bd84e4a commit 9d2a45a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/compress/zstd_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,11 @@ static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t* const optP
* Provides the cost of the match part (offset + matchLength) of a sequence
* Must be combined with ZSTD_fullLiteralsCost() to get the full cost of a sequence.
* optLevel: when <2, favors small offset for decompression speed (improved cache efficiency) */
static U32 ZSTD_getMatchPrice(U32 const offset,
U32 const matchLength,
const optState_t* const optPtr,
int const optLevel)
FORCE_INLINE_TEMPLATE U32
ZSTD_getMatchPrice(U32 const offset,
U32 const matchLength,
const optState_t* const optPtr,
int const optLevel)
{
U32 price;
U32 const offCode = ZSTD_highbit32(offset+1);
Expand Down Expand Up @@ -512,9 +513,11 @@ static U32 ZSTD_insertBt1(
}
}

static void ZSTD_updateTree_internal(ZSTD_matchState_t* ms,
const BYTE* const ip, const BYTE* const iend,
const U32 mls, const ZSTD_dictMode_e dictMode)
FORCE_INLINE_TEMPLATE
void ZSTD_updateTree_internal(
ZSTD_matchState_t* ms,
const BYTE* const ip, const BYTE* const iend,
const U32 mls, const ZSTD_dictMode_e dictMode)
{
const BYTE* const base = ms->window.base;
U32 const target = (U32)(ip - base);
Expand All @@ -536,7 +539,8 @@ void ZSTD_updateTree(ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iend) {
ZSTD_updateTree_internal(ms, ip, iend, ms->cParams.minMatch, ZSTD_noDict);
}

static U32 ZSTD_insertBtAndGetAllMatches (
FORCE_INLINE_TEMPLATE
U32 ZSTD_insertBtAndGetAllMatches (
ZSTD_match_t* matches, /* store result (found matches) in this table (presumed large enough) */
ZSTD_matchState_t* ms,
U32* nextToUpdate3,
Expand Down Expand Up @@ -769,7 +773,7 @@ static U32 ZSTD_insertBtAndGetAllMatches (
}


static U32 ZSTD_BtGetAllMatches (
FORCE_INLINE_TEMPLATE U32 ZSTD_BtGetAllMatches (
ZSTD_match_t* matches, /* store result (match found, increasing size) in this table */
ZSTD_matchState_t* ms,
U32* nextToUpdate3,
Expand Down Expand Up @@ -956,7 +960,7 @@ listStats(const U32* table, int lastEltID)

#endif

static size_t
FORCE_INLINE_TEMPLATE size_t
ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
seqStore_t* seqStore,
U32 rep[ZSTD_REP_NUM],
Expand Down

0 comments on commit 9d2a45a

Please sign in to comment.