MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ZSTD_updateTree_internal

Function ZSTD_updateTree_internal

freebsd/contrib/zstd/lib/compress/zstd_opt.c:482–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482FORCE_INLINE_TEMPLATE
483void ZSTD_updateTree_internal(
484 ZSTD_matchState_t* ms,
485 const BYTE* const ip, const BYTE* const iend,
486 const U32 mls, const ZSTD_dictMode_e dictMode)
487{
488 const BYTE* const base = ms->window.base;
489 U32 const target = (U32)(ip - base);
490 U32 idx = ms->nextToUpdate;
491 DEBUGLOG(6, "ZSTD_updateTree_internal, from %u to %u (dictMode:%u)",
492 idx, target, dictMode);
493
494 while(idx < target) {
495 U32 const forward = ZSTD_insertBt1(ms, base+idx, iend, mls, dictMode == ZSTD_extDict);
496 assert(idx < (U32)(idx + forward));
497 idx += forward;
498 }
499 assert((size_t)(ip - base) <= (size_t)(U32)(-1));
500 assert((size_t)(iend - base) <= (size_t)(U32)(-1));
501 ms->nextToUpdate = target;
502}
503
504void ZSTD_updateTree(ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iend) {
505 ZSTD_updateTree_internal(ms, ip, iend, ms->cParams.minMatch, ZSTD_noDict);

Callers 2

ZSTD_updateTreeFunction · 0.70
ZSTD_BtGetAllMatchesFunction · 0.70

Calls 1

ZSTD_insertBt1Function · 0.70

Tested by

no test coverage detected