1

In a c++ project I have a function using deflateInit2 method of ZLIB.

ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
                                     int  level,
                                     int  method,
                                     int  windowBits,
                                     int  memLevel,
                                     int  strategy));

Now I am trying to find a similar functionality for ZSTD. For example the windowBits part is resolved by calling the

ZSTD_CCtx_setParameter(this->context, ZSTD_c_windowLog, windowBits);

methon of ZSTD. The strategy also has such an equivalent. The main question concerns memLevel. How to specify something like memLevel ZLIB parameter for ZSTD?

Vahag Chakhoyan
  • 873
  • 1
  • 10
  • 21

1 Answers1

1

Use the parameter ZSTD_c_jobSize as in

ZSTD_CCtx_setParameter(this->context,ZSTD_c_jobSize,maxSize);

Job size must be a minimum of overlap size, or ZSTDMT_JOBSIZE_MIN (= 512 KB), whichever is largest.

https://zstd.docsforge.com/dev/api/ZSTD_cParameter/#ZSTD_c_jobSize

Something Something
  • 3,999
  • 1
  • 6
  • 21