Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\compress.c Create Date:2022-07-28 07:03:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: : nb of positions added

Proto:static U32 ZSTD_insertBt1(ZSTD_CCtx *zc, const BYTE *const ip, const U32 mls, const BYTE *const iend, U32 nbCompares, U32 extDict)

Type:U32

Parameter:

TypeParameterName
ZSTD_CCtx *zc
const BYTE *constip assumed <= iend-8 .
const U32mls
const BYTE *constiend
U32nbCompares
U32extDict

Brief:ZSTD_insertBt1() : add one or multiple positions to tree.

1563  hashTable = hashTable
1564  hashLog = hashLog
1565  h = ZSTD_hashPtr( assumed <= iend-8 ., hashLog, mls)
1566  bt = chainTable
1567  btLog = chainLog - 1
1568  btMask = (1 << btLog) - 1
1569  matchIndex = hashTable[h]
1570  commonLengthSmaller = 0 , commonLengthLarger = 0
1571  base = base
1572  dictBase = dictBase
1573  dictLimit = dictLimit
1574  dictEnd = dictBase + dictLimit
1575  prefixStart = base + dictLimit
1577  curr = assumed <= iend-8 . - base
1578  btLow = If btMask >= curr Then 0 Else curr - btMask
1579  smallerPtr = bt + 2 * (curr & btMask)
1580  largerPtr = smallerPtr + 1
1582  windowLow = lowLimit
1583  matchEndIdx = curr + 8
1584  bestLength = 8
1586  hashTable[h] = curr
1588  When nbCompares-- && matchIndex > windowLow cycle
1589  nextPtr = bt + 2 * (matchIndex & btMask)
1590  matchLength = -************************************** shared macros(commonLengthSmaller, commonLengthLarger)
1592  If Not extDict || matchIndex + matchLength >= dictLimit Then
1593  match = base + matchIndex
1596  Else
1603  If matchLength > bestLength Then
1609  If assumed <= iend-8 . + matchLength == iend Then Break
1616  If matchIndex <= btLow Then
1617  smallerPtr = dummy32
1618  Break
1620  smallerPtr = nextPtr + 1
1621  matchIndex = nextPtr[1]
1622  Else
1626  If matchIndex <= btLow Then
1627  largerPtr = dummy32
1628  Break
1630  largerPtr = nextPtr
1631  matchIndex = nextPtr[0]
1635  smallerPtr = largerPtr = 0
1636  If bestLength > 384 Then Return -************************************** shared macros(192, (U32)(bestLength - 384))
1638  If matchEndIdx > curr + 8 Then Return matchEndIdx - curr - 8
1640  Return 1
Caller
NameDescribe
ZSTD_updateTree
ZSTD_updateTree_extDict