函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:LZ4_decompress_generic() :* This generic decompression function covers all use cases.* It shall be instantiated several times, using different sets of directives.* Note that it is important for performance that this function really get inlined,

函数原型:static inline __attribute__((__always_inline__)) int LZ4_decompress_generic(const char *const src, char *const dst, int srcSize, int outputSize, endCondition_directive endOnInput, earlyEnd_directive partialDecoding, dict_directive dict, const BYTE *const lowPrefix, const BYTE *const dictStart, const size_t dictSize)

返回类型:int

参数:

类型参数名称
const char *constsrc
char *constdst
intsrcSize
intoutputSizeIf endOnInput == endOnInputSize,* this value is `dstCapacity`
endCondition_directiveendOnInputdOnOutputSize, endOnInputSize
earlyEnd_directivepartialDecodingull, partial
dict_directivedictDict, withPrefix64k, usingExtDict
const BYTE *constlowPrefixalways <= dst, == dst when no prefix
const BYTE *constdictStartly if dict == usingExtDict
const size_tdictSize : = 0 if noDict
83  ip等于src
84  iend等于ipsrcSize
86  op等于dst
87  oend等于opIf endOnInput == endOnInputSize,* this value is `dstCapacity`
90  dictEnd等于ly if dict == usingExtDict : = 0 if noDict
91  static const unsigned int inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4}
92  static const int dec64table[8] = {0, 0, 0, - 1, - 4, 1, 2, 3}
94  safeDecode等于dOnOutputSize, endOnInputSize 恒等于endOnInputSize
95  checkOffset等于safeDecode : = 0 if noDict 小于64乘KB
98  shortiend等于iend减如果dOnOutputSize, endOnInputSize 则14否则8减2
100  shortoend等于oend减如果dOnOutputSize, endOnInputSize 则14否则8减18
107  assert(always <= dst, == dst when no prefix <= op)
108  assert(src != NULL)
111  如果dOnOutputSize, endOnInputSize 此条件成立可能性小(为编译器优化)(If endOnInput == endOnInputSize,* this value is `dstCapacity` == 0)则返回:如果srcSize恒等于1且ip恒等于0则0否则负1
114  如果非dOnOutputSize, endOnInputSize 此条件成立可能性小(为编译器优化)(If endOnInput == endOnInputSize,* this value is `dstCapacity` == 0)则返回:如果ip恒等于0则1否则负1
117  如果dOnOutputSize, endOnInputSize 此条件成立可能性小(为编译器优化)(srcSize == 0)则返回:负1
121  当1循环
127  token等于ip自加
128  length等于token右移ML_BITS
131  assert(!dOnOutputSize, endOnInputSize || ip <= iend)
154  op加等于length
154  ip加等于length
161  length等于token按位与ML_MASK
162  offset等于LZ4_readLE16(ip)
163  ip加等于2
164  match等于opoffset
165  assert(match <= op)
168  如果length不等于ML_MASKoffset大于等于8且Dict, withPrefix64k, usingExtDict 恒等于withPrefix64kmatch大于等于always <= dst, == dst when no prefix 的值则
172  内存复制(op + 0, match + 0, 8)
173  内存复制(op + 8, match + 8, 8)
174  内存复制(op + 16, match + 16, 2)
177  继续下一循环
185  转到:_copy_match
189  如果length恒等于RUN_MASK
194  转到:_output_error
196  循环
197  s等于ip自加
198  length加等于s
207  转到:_output_error
213  转到:_output_error
218  cpy等于oplength
219  LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH)
224  如果ull, partial
225  如果cpy大于oend
230  cpy等于oend
231  length等于oendop
233  如果dOnOutputSize, endOnInputSize iplength大于iend
240  转到:_output_error
242  否则
243  如果非dOnOutputSize, endOnInputSize cpy不等于oend
250  转到:_output_error
252  如果dOnOutputSize, endOnInputSize iplength不等于iendcpy大于oend的值则
259  转到:_output_error
264  ip加等于length
265  op加等于length
268  如果非ull, partial cpy恒等于oend退出
270  否则
273  ip加等于length
274  op等于cpy
278  offset等于LZ4_readLE16(ip)
279  ip加等于2
280  match等于opoffset
283  length等于token按位与ML_MASK
285  _copy_match :
288  转到:_output_error
296  如果非ull, partial
297  assert(oend > op)
298  assert(oend - op >= 4)
303  如果length恒等于ML_MASK
306  循环
307  s等于ip自加
312  length加等于s
313 s恒等于255循环
319  转到:_output_error
323  length加等于-************************************* Constants
329  如果非ull, partial 则转到:_output_error
331  length等于两数取小(length, (size_t)(oend - op))
334  如果length小于等于always <= dst, == dst when no prefix match
342  否则
364  继续下一循环
368  cpy等于oplength
374  assert(op <= oend)
377  mlen等于两数取小(length, (size_t)(oend - op))
378  matchEnd等于matchmlen
379  copyEnd等于opmlen
381  如果matchEnd大于op
383 op小于copyEnd循环
384  op自加等于match自加
385  否则
388  op等于copyEnd
389  如果op恒等于oend退出
391  继续下一循环
395  op[0]等于match[0]
396  op[1]等于match[1]
397  op[2]等于match[2]
398  op[3]等于match[3]
399  match加等于inc32table[offset]
400  内存复制(op + 4, match, 4)
401  match减等于dec64table[offset]
402  否则
403  LZ4_copy8(op, match)
404  match加等于8
407  op加等于8
410  oCopyLimit等于oendWILDCOPYLENGTH减1
412  如果cpy大于oendLASTLITERALS
417  转到:_output_error
420  如果op小于oCopyLimit
425 op小于cpy循环
426  op自加等于match自加
427  否则
428  LZ4_copy8(op, match)
432  op等于cpy
436  如果dOnOutputSize, endOnInputSize
438  返回:opdst
439  否则
441  返回:ipsrc
445  _output_error :
446  返回:负ipsrc的差减1
调用者
名称描述
LZ4_decompress_safe
LZ4_decompress_safe_partial
LZ4_decompress_fast
LZ4_decompress_safe_withPrefix64k===== Instantiate a few more decoding cases, used more than once. =====
LZ4_decompress_safe_withSmallPrefix
LZ4_decompress_safe_forceExtDict
LZ4_decompress_fast_extDict
LZ4_decompress_safe_doubleDictThe "double dictionary" mode, for use with e.g. ring buffers: the first part* of the dictionary is passed as prefix, and the second via dictStart + dictSize.* These routines are used only once, in LZ4_decompress_*_continue().
LZ4_decompress_fast_doubleDict