函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: : compressed size, or an error code

函数原型:static size_t ZSTD_compress_generic(ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastFrameChunk)

返回类型:size_t

参数:

类型参数名称
ZSTD_CCtx *cctx
void *dst
size_tdstCapacity
const void *src
size_tsrcSize
U32lastFrameChunk

摘要:! ZSTD_compress_generic() :* Compress a chunk of data into one or multiple blocks.* All blocks will be terminated, all input will be consumed.* Function will issue an error if there is not enough `dstCapacity` to hold the compressed content.* Frame is supposed already started (header already produced)

2357  blockSize等于blockSize
2358  remaining等于srcSize
2359  ip等于src
2360  ostart等于dst
2361  op等于ostart
2362  maxDist等于1左移windowLog
2364  如果checksumFlagsrcSizexxh64_update( & xxhState, src, srcSize)
2367 remaining循环
2368  lastBlock等于lastFrameChunk按位与blockSize大于等于remaining
2371  如果dstCapacity小于ZSTD_blockHeaderSizer a non-null block 则返回:-***************************************** Error codes handling(dstSize_tooSmall)
2373  如果remaining小于blockSizeblockSize等于remaining
2377  如果lowLimit大于3U左移29位则
2379  curr等于ipbase
2380  newCurr等于curr按位与cycleMask的值加1左移windowLog位的值
2381  correction等于currnewCurr
2384  base加等于correction
2385  dictBase加等于correction
2386  lowLimit减等于correction
2387  dictLimit减等于correction
2388  如果nextToUpdate小于correctionnextToUpdate等于0
2390  否则nextToUpdate减等于correction
2394  如果ipblockSizebase大于loadedDictEndmaxDist
2396  newLowLimit等于ipblockSizebasemaxDist
2397  如果lowLimit小于newLowLimitlowLimit等于newLowLimit
2399  如果dictLimit小于lowLimitdictLimit等于lowLimit
2403  cSize等于ZSTD_compressBlock_internal(cctx, op + ZSTD_blockHeaderSize, dstCapacity - ZSTD_blockHeaderSize, ip, blockSize)
2404  如果ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error.则返回:cSize
2407  如果cSize恒等于0则
2408  cBlockHeader24等于lastBlockbt_raw左移1位的值加blockSize左移3位的值
2414  否则
2415  cBlockHeader24等于lastBlockbt_compressed左移1位的值加cSize左移3位的值
2417  cSize加等于ZSTD_blockHeaderSize
2420  remaining减等于blockSize
2421  dstCapacity减等于cSize
2422  ip加等于blockSize
2423  op加等于cSize
2426  如果lastFrameChunkop大于ostartstage等于ZSTDcs_ending
2428  返回:opostart
调用者
名称描述
ZSTD_compressContinue_internal