added ZSTD_COMPRESSBOUND() as a macro
ZSTD_compressBound() works fine, but is only useful for dynamic allocation. For static allocation, only a macro can provide the amount during compilation time.
This commit is contained in:
1 parent
e580dc6a4a
commit
5b10345b26
2 files changed
+3
-4
No files matched your search
@@ -38,9 +38,7 @@
|
||||
* Helper functions
|
||||
***************************************/
|
||||
size_t ZSTD_compressBound(size_t srcSize) {
|
||||
size_t const lowLimit = 256 KB;
|
||||
size_t const margin = (srcSize < lowLimit) ? (lowLimit-srcSize) >> 12 : 0; /* from 64 to 0 */
|
||||
return srcSize + (srcSize >> 8) + margin;
|
||||
return ZSTD_COMPRESSBOUND(srcSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user