Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: : compressed size, or an error code

Proto:static size_t ZSTD_compress_generic(ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastFrameChunk)

Type:size_t

Parameter:

TypeParameterName
ZSTD_CCtx *cctx
void *dst
size_tdstCapacity
const void *src
size_tsrcSize
U32lastFrameChunk

Brief:! 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  If checksumFlag && srcSize Then xxh64_update( & xxhState, src, srcSize)
2367  When remaining cycle
2368  lastBlock = lastFrameChunk & blockSize >= remaining
2371  If dstCapacity < ZSTD_blockHeaderSize + r a non-null block Then Return -***************************************** Error codes handling(dstSize_tooSmall)
2373  If remaining < blockSize Then blockSize = remaining
2377  If lowLimit > 3U << 29 Then
2379  curr = ip - base
2380  newCurr = (curr & cycleMask) + (1 << windowLog)
2381  correction = curr - newCurr
2384  base += correction
2385  dictBase += correction
2386  lowLimit -= correction
2387  dictLimit -= correction
2388  If nextToUpdate < correction Then nextToUpdate = 0
2390  Else nextToUpdate -= correction
2394  If ip + blockSize - base > loadedDictEnd + maxDist Then
2399  If dictLimit < lowLimit Then dictLimit = lowLimit
2403  cSize = ZSTD_compressBlock_internal(cctx, op + ZSTD_blockHeaderSize, dstCapacity - ZSTD_blockHeaderSize, ip, blockSize)
2404  If 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. Then Return cSize
2407  If cSize == 0 Then
2408  cBlockHeader24 = lastBlock + (bt_raw << 1) + (blockSize << 3)
2414  Else
2415  cBlockHeader24 = lastBlock + (bt_compressed << 1) + (cSize << 3)
2420  remaining -= blockSize
2421  dstCapacity -= cSize
2422  ip += blockSize
2423  op += cSize
2426  If lastFrameChunk && op > ostart Then stage = ZSTDcs_ending
2428  Return op - ostart
Caller
NameDescribe
ZSTD_compressContinue_internal