aboutsummaryrefslogtreecommitdiff
path: root/nDPId.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-11-30 22:29:48 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-12-01 06:43:39 +0100
commit37f3770e3e1b6659d3658f28d394bd9ccd5dc8a5 (patch)
treebda19aa2020e7e55b19e85d24c1d9003a3e4d52d /nDPId.c
parent7368d34d8d58e37746a6ce3af39fd5cd1f36bf48 (diff)
Improved zlib compression ratio.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPId.c')
-rw-r--r--nDPId.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nDPId.c b/nDPId.c
index 109a3ddbe..86c57290f 100644
--- a/nDPId.c
+++ b/nDPId.c
@@ -90,7 +90,6 @@
pthread_mutex_init(&name.var_mutex, NULL); \
} while (0)
-WARN_UNUSED
static inline uint64_t mt_pt_get_and_add(volatile uint64_t * value, uint64_t add, pthread_mutex_t * mutex)
{
uint64_t result;
@@ -103,7 +102,6 @@ static inline uint64_t mt_pt_get_and_add(volatile uint64_t * value, uint64_t add
#define MT_GET_AND_ADD(name, value) mt_pt_get_and_add(&name.var, value, &name.var_mutex)
-WARN_UNUSED
static inline uint64_t mt_pt_get_and_sub(volatile uint64_t * value, uint64_t sub, pthread_mutex_t * mutex)
{
uint64_t result;
@@ -693,7 +691,10 @@ static int zlib_deflate(const void * const src, int srcLen, void * dst, int dstL
int err = -1;
int ret = -1;
- err = deflateInit(&strm, Z_BEST_COMPRESSION);
+ err = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_BINARY, 15, 9, Z_HUFFMAN_ONLY);
+ if (err != Z_OK) {
+ err = deflateInit(&strm, Z_BEST_COMPRESSION);
+ }
if (err == Z_OK)
{
err = deflate(&strm, Z_FINISH);