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

Function BIT_closeCStream

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

! BIT_closeCStream() : * @return : size of CStream, in bytes, * or 0 if it could not fit into dstBuffer */

Source from the content-addressed store, hash-verified

1548 * @return : size of CStream, in bytes,
1549 * or 0 if it could not fit into dstBuffer */
1550MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC)
1551{
1552 BIT_addBitsFast(bitC, 1, 1); /* endMark */
1553 BIT_flushBits(bitC);
1554 if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */
1555 return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);
1556}
1557
1558
1559/*-********************************************************

Calls 2

BIT_addBitsFastFunction · 0.70
BIT_flushBitsFunction · 0.70

Tested by

no test coverage detected