函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\compress.c Create Date:2022-07-27 08:01:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ZSTD_insertBtAndFindBestMatch

函数原型:static size_t ZSTD_insertBtAndFindBestMatch(ZSTD_CCtx *zc, const BYTE *const ip, const BYTE *const iend, size_t *offsetPtr, U32 nbCompares, const U32 mls, U32 extDict)

返回类型:size_t

参数:

类型参数名称
ZSTD_CCtx *zc
const BYTE *constip
const BYTE *constiend
size_t *offsetPtr
U32nbCompares
const U32mls
U32extDict
1646  hashTable等于hashTable
1647  hashLog等于hashLog
1648  h等于ZSTD_hashPtr(ip, hashLog, mls)
1649  bt等于chainTable
1650  btLog等于chainLog减1
1651  btMask等于1左移btLog位的值减1
1652  matchIndex等于hashTable[h]
1653  commonLengthSmaller等于0, commonLengthLarger等于0
1654  base等于base
1655  dictBase等于dictBase
1656  dictLimit等于dictLimit
1657  dictEnd等于dictBasedictLimit
1658  prefixStart等于basedictLimit
1659  curr等于ipbase
1660  btLow等于如果btMask大于等于curr则0否则currbtMask
1661  windowLow等于lowLimit
1662  smallerPtr等于bt加2乘curr按位与btMask的值
1663  largerPtr等于bt加2乘curr按位与btMask的值加1
1664  matchEndIdx等于curr加8
1666  bestLength等于0
1668  hashTable[h]等于curr
1670 nbCompares自减且matchIndex大于windowLow循环
1671  nextPtr等于bt加2乘matchIndex按位与btMask的值
1672  matchLength等于-************************************** shared macros(commonLengthSmaller, commonLengthLarger)
1675  如果非extDictmatchIndexmatchLength大于等于dictLimit
1676  match等于basematchIndex
1677  如果match[matchLength]恒等于ip[matchLength]则matchLength加等于ZSTD_count(ip + matchLength + 1, match + matchLength + 1, iend)加1
1679  否则
1680  match等于dictBasematchIndex
1682  如果matchIndexmatchLength大于等于dictLimitmatch等于basematchIndex
1686  如果matchLength大于bestLength
1691  如果ipmatchLength恒等于iend退出
1695  如果match[matchLength]小于ip[matchLength]则
1697  smallerPtr等于matchIndex
1699  如果matchIndex小于等于btLow
1700  smallerPtr等于dummy32
1701  退出
1703  smallerPtr等于nextPtr加1
1704  matchIndex等于nextPtr[1]
1705  否则
1707  largerPtr等于matchIndex
1709  如果matchIndex小于等于btLow
1710  largerPtr等于dummy32
1711  退出
1713  largerPtr等于nextPtr
1714  matchIndex等于nextPtr[0]
1718  smallerPtr等于largerPtr等于0
1720  nextToUpdate等于如果matchEndIdx大于curr加8则matchEndIdx减8否则curr加1
1721  返回:bestLength
调用者
名称描述
ZSTD_BtFindBestMatchZSTD_BtFindBestMatch() : Tree updater, providing best match
ZSTD_BtFindBestMatch_extDictTree updater, providing best match