separated bench module into benchfn and benchzstd

it shall be possible to use benchfn
without any dependency on zstd.
This commit is contained in:
Yann Collet
2018-11-13 11:01:59 -08:00
parent 626040ab53
commit d38063f8ae
11 changed files with 470 additions and 340 deletions
+2 -2
View File
@@ -28,14 +28,14 @@ default: largeNbDicts
all : largeNbDicts
largeNbDicts: util.o bench.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD)
largeNbDicts: util.o benchfn.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD)
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
.PHONY: $(LIBZSTD)
$(LIBZSTD):
$(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)"
bench.o : $(PROGDIR)/bench.c
benchfn.o : $(PROGDIR)/benchfn.c
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -c
datagen.o: $(PROGDIR)/datagen.c
+2 -1
View File
@@ -24,7 +24,7 @@
#include <assert.h> /* assert */
#include "util.h"
#include "bench.h"
#include "benchfn.h"
#define ZSTD_STATIC_LINKING_ONLY
#include "zstd.h"
#include "zdict.h"
@@ -543,6 +543,7 @@ static int benchMem(slice_collection_t dstBlocks,
BMK_runOutcome_t const outcome = BMK_benchTimedFn(benchState,
decompress, &di,
NULL, NULL,
ZSTD_isError,
dstBlocks.nbSlices,
(const void* const *)srcBlocks.slicePtrs, srcBlocks.capacities,
dstBlocks.slicePtrs, dstBlocks.capacities,