MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / zstdCompressBound

Function zstdCompressBound

src/openrct2/core/Compression.cpp:147–151  ·  view source on GitHub ↗

* Modified copy of ZSTD_COMPRESSBOUND / ZSTD_compressBound() from zstd 1.5.7, with the argument * type changed from size_t (which may be only 32 bits) to uint64_t, and removes the error handling. */

Source from the content-addressed store, hash-verified

145 * type changed from size_t (which may be only 32 bits) to uint64_t, and removes the error handling.
146 */
147 static uint64_t zstdCompressBound(uint64_t length)
148 {
149 return length + (length >> 8)
150 + ((length < (128uLL << 10)) ? (((128uLL << 10) - length) >> 11) /* margin, from 64 to 0 */ : 0uLL);
151 }
152
153 bool zstdCompress(IStream& source, uint64_t sourceLength, IStream& dest, ZstdMetadata metadata, int16_t level)
154 {

Callers 1

zstdCompressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected