MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ZSTD_getSequences

Function ZSTD_getSequences

freebsd/contrib/openzfs/module/zstd/lib/zstd.c:15449–15467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15447}
15448
15449size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs,
15450 size_t outSeqsSize, const void* src, size_t srcSize)
15451{
15452 const size_t dstCapacity = ZSTD_compressBound(srcSize);
15453 void* dst = ZSTD_malloc(dstCapacity, ZSTD_defaultCMem);
15454 SeqCollector seqCollector;
15455
15456 RETURN_ERROR_IF(dst == NULL, memory_allocation, "NULL pointer!");
15457
15458 seqCollector.collectSequences = 1;
15459 seqCollector.seqStart = outSeqs;
15460 seqCollector.seqIndex = 0;
15461 seqCollector.maxSequences = outSeqsSize;
15462 zc->seqCollector = seqCollector;
15463
15464 ZSTD_compress2(zc, dst, dstCapacity, src, srcSize);
15465 ZSTD_free(dst, ZSTD_defaultCMem);
15466 return zc->seqCollector.seqIndex;
15467}
15468
15469/* Returns true if the given block is a RLE block */
15470static int ZSTD_isRLE(const BYTE *ip, size_t length) {

Callers

nothing calls this directly

Calls 4

ZSTD_mallocFunction · 0.85
ZSTD_freeFunction · 0.85
ZSTD_compressBoundFunction · 0.70
ZSTD_compress2Function · 0.70

Tested by

no test coverage detected