]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix : propagate custom allocator to ZSTDMT though ZSTD_CCtx_setParameter()
authorYann Collet <cyan@fb.com>
Mon, 10 Jul 2017 21:02:33 +0000 (14:02 -0700)
committerYann Collet <cyan@fb.com>
Mon, 10 Jul 2017 21:02:33 +0000 (14:02 -0700)
also : compile fuzzer with MT enabled

lib/compress/zstd_compress.c
tests/Makefile

index 9300357f2d3887abb44a99507270c00252ad7f1f..c17645de750aaff52479393064c7860794d4c801 100644 (file)
@@ -377,7 +377,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v
                 return ERROR(compressionParameter_unsupported);
             ZSTDMT_freeCCtx(cctx->mtctx);
             cctx->nbThreads = 1;
-            cctx->mtctx = ZSTDMT_createCCtx(value);
+            cctx->mtctx = ZSTDMT_createCCtx_advanced(value, cctx->customMem);
             if (cctx->mtctx == NULL) return ERROR(memory_allocation);
         }
         cctx->nbThreads = value;
index 345e0e8eb3beaf4905653c43b9f3030d87db29a5..4784136e14c9e9038828ee3b369ad1154666ee9d 100644 (file)
@@ -79,7 +79,7 @@ all32: fullbench32 fuzzer32 zstreamtest32
 
 allnothread: fullbench fuzzer paramgrill datagen  decodecorpus
 
-dll: fuzzer-dll zstreamtest-dll 
+dll: fuzzer-dll zstreamtest-dll
 
 zstd:
        $(MAKE) -C $(PRGDIR) $@
@@ -108,11 +108,11 @@ fullbench-dll: $(PRGDIR)/datagen.c fullbench.c
        $(MAKE) -C $(ZSTDDIR) libzstd
        $(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll
 
-fuzzer   : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c
-       $(CC)      $(FLAGS) $^ -o $@$(EXT)
-
-fuzzer32 : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c
-       $(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+fuzzer : CPPFLAGS += $(MULTITHREAD_CPP)
+fuzzer : LDFLAGS += $(MULTITHREAD_LD)
+fuzzer32: CFLAGS += -m32
+fuzzer fuzzer32 : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c
+       $(CC) $(FLAGS) $^ -o $@$(EXT)
 
 fuzzer-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd
 fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c fuzzer.c