summaryrefslogtreecommitdiffstats
path: root/examples/blockStreaming_ringBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/blockStreaming_ringBuffer.c')
-rw-r--r--examples/blockStreaming_ringBuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/blockStreaming_ringBuffer.c b/examples/blockStreaming_ringBuffer.c
index beb5e66..697d342 100644
--- a/examples/blockStreaming_ringBuffer.c
+++ b/examples/blockStreaming_ringBuffer.c
@@ -64,8 +64,9 @@ void test_compress(FILE* outFp, FILE* inpFp)
if (0 == inpBytes) break;
{
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
- const int cmpBytes = LZ4_compress_continue(lz4Stream, inpPtr, cmpBuf, inpBytes);
+#define CMPBUFSIZE (LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES))
+ char cmpBuf[CMPBUFSIZE];
+ const int cmpBytes = LZ4_compress_fast_continue(lz4Stream, inpPtr, cmpBuf, inpBytes, CMPBUFSIZE, 0);
if(cmpBytes <= 0) break;
write_int32(outFp, cmpBytes);
write_bin(outFp, cmpBuf, cmpBytes);
@@ -90,7 +91,7 @@ void test_decompress(FILE* outFp, FILE* inpFp)
for(;;) {
int cmpBytes = 0;
- char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
+ char cmpBuf[CMPBUFSIZE];
{
const size_t r0 = read_int32(inpFp, &cmpBytes);