- The build macro `ZSTD_NO_INTRINSICS` can be defined to disable all explicit intrinsics.
Compiler builtins are still used.
-- The build macro `ZSTD_LITBUFFEREXTRASIZE` can be set to control the amount of extra memory used
- during decompression to store literals. This defaults to 64kB. Reducing it can reduce the
- memory footprint required for decompression by increasing the portion of the literal buffer that
- is stored in the unwritten portion of the dst buffer, at the cost of performance impact for
- decompression.
+- The build macro `ZSTD_DECODER_INTERNAL_BUFFER` can be set to control
+ the amount of extra memory used during decompression to store literals.
+ This defaults to 64kB. Reducing this value reduces the memory footprint of
+ `ZSTD_DCtx` decompression contexts,
+ but might also result in a small decompression speed cost.
#### Windows : using MinGW+MSYS to create DLL
size_t ddictPtrCount;
} ZSTD_DDictHashSet;
-#ifndef ZSTD_LITBUFFEREXTRASIZE
-#define ZSTD_LITBUFFEREXTRASIZE (1 << 16) /* extra buffer reduces amount of dst required to store litBuffer */
+#ifndef ZSTD_DECODER_INTERNAL_BUFFER
+# define ZSTD_DECODER_INTERNAL_BUFFER (1 << 16)
#endif
+#define ZSTD_LBMAX (128 << 10)
+
+/* extra buffer, compensates amount of dst required to store litBuffer */
+#define ZSTD_LITBUFFEREXTRASIZE MIN(ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
+
typedef enum {
ZSTD_not_in_dst = 0, /* Stored entirely within litExtraBuffer */
ZSTD_in_dst = 1, /* Stored entirely within dst (in memory after current output write) */