Skip to content

Commit 2ff87ae

Browse files
committed
fix FreeBSD
use an alias instead of a function also: added more traces and updated version nb to v1.5.8
1 parent c18374b commit 2ff87ae

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

lib/zstd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extern "C" {
111111
/*------ Version ------*/
112112
#define ZSTD_VERSION_MAJOR 1
113113
#define ZSTD_VERSION_MINOR 5
114-
#define ZSTD_VERSION_RELEASE 7
114+
#define ZSTD_VERSION_RELEASE 8
115115
#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
116116

117117
/*! ZSTD_versionNumber() :

programs/zstdcli.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,12 @@ static void printVersion(void)
686686
DISPLAYOUT("lz4 version %s\n", FIO_lz4Version());
687687
DISPLAYOUT("lzma version %s\n", FIO_lzmaVersion());
688688

689+
#ifdef ZSTD_MULTITHREAD
690+
DISPLAYOUT("supports Multithreading \n");
691+
#else
692+
DISPLAYOUT("single-thread operations only \n");
693+
#endif
694+
689695
/* posix support */
690696
#ifdef _POSIX_C_SOURCE
691697
DISPLAYOUT("_POSIX_C_SOURCE defined: %ldL\n", (long) _POSIX_C_SOURCE);
@@ -1336,7 +1342,7 @@ int main(int argCount, const char* argv[])
13361342

13371343
#ifdef ZSTD_MULTITHREAD
13381344
if ((nbWorkers==NBWORKERS_AUTOCPU) && (!singleThread)) {
1339-
/* automatically set # workers based on # of reported cpus */
1345+
/* automatically set # workers based on # of reported cpu cores */
13401346
if (defaultLogicalCores) {
13411347
nbWorkers = (unsigned)UTIL_countLogicalCores();
13421348
DISPLAYLEVEL(3, "Note: %d logical core(s) detected \n", nbWorkers);
@@ -1345,7 +1351,7 @@ int main(int argCount, const char* argv[])
13451351
DISPLAYLEVEL(3, "Note: %d physical core(s) detected \n", nbWorkers);
13461352
}
13471353
}
1348-
if (operation != zom_bench)
1354+
if (operation == zom_compress)
13491355
DISPLAYLEVEL(4, "Compressing with %u worker threads \n", nbWorkers);
13501356
#else
13511357
(void)singleThread; (void)nbWorkers; (void)defaultLogicalCores;

tests/playTests.sh

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
set -e # exit immediately on error
4-
# set -x # print commands before execution (debug)
4+
set -x # print commands before execution (debug)
55

66
unset ZSTD_CLEVEL
77
unset ZSTD_NBTHREADS
@@ -16,13 +16,7 @@ datagen() {
1616
"$DATAGEN_BIN" "$@"
1717
}
1818

19-
zstd() {
20-
if [ -z "$EXE_PREFIX" ]; then
21-
"$ZSTD_BIN" "$@"
22-
else
23-
"$EXE_PREFIX" "$ZSTD_BIN" "$@"
24-
fi
25-
}
19+
alias zstd="$EXE_PREFIX $ZSTD_BIN"
2620

2721
sudoZstd() {
2822
if [ -z "$EXE_PREFIX" ]; then
@@ -1563,18 +1557,16 @@ then
15631557
println "\n===> zstdmt environment variable tests "
15641558
echo "multifoo" >> mt_tmp
15651559
ZSTD_NBTHREADS=-3 zstd -f mt_tmp # negative value, warn and revert to default setting
1566-
ZSTD_NBTHREADS='' zstd -f mt_tmp # empty env var, warn and revert to default setting
1567-
ZSTD_NBTHREADS=- zstd -f mt_tmp # malformed env var, warn and revert to default setting
1568-
ZSTD_NBTHREADS=a zstd -f mt_tmp # malformed env var, warn and revert to default setting
1569-
ZSTD_NBTHREADS=+a zstd -f mt_tmp # malformed env var, warn and revert to default setting
1560+
ZSTD_NBTHREADS='' zstd -f mt_tmp # empty env var, warn and revert to default setting
1561+
ZSTD_NBTHREADS=- zstd -f mt_tmp # malformed env var, warn and revert to default setting
1562+
ZSTD_NBTHREADS=a zstd -f mt_tmp # malformed env var, warn and revert to default setting
1563+
ZSTD_NBTHREADS=+a zstd -f mt_tmp # malformed env var, warn and revert to default setting
15701564
ZSTD_NBTHREADS=3a7 zstd -f mt_tmp # malformed env var, warn and revert to default setting
15711565
ZSTD_NBTHREADS=50000000000 zstd -f mt_tmp # numeric value too large, warn and revert to default setting=
15721566
ZSTD_NBTHREADS=2 zstd -f mt_tmp # correct usage
15731567
ZSTD_NBTHREADS=1 zstd -f mt_tmp # correct usage: single worker
1574-
ZSTD_NBTHREADS=4 zstd -f mt_tmp -vv 2>&1 | grep "4 worker threads" # check message
1575-
zstd -tq mt_tmp.zst
1576-
ZSTD_NBTHREADS=0 zstd -f mt_tmp -vv 2>&1 | grep "core(s) detected" # check core count autodetection is triggered
1577-
zstd -tq mt_tmp.zst
1568+
ZSTD_NBTHREADS=4 zstd -f mt_tmp -vv 2>&1 | $GREP "4 worker threads" # check message
1569+
ZSTD_NBTHREADS=0 zstd -f mt_tmp -vv 2>&1 | $GREP "core(s) detected" # check core count autodetection is triggered
15781570
# temporary envvar changes in the above tests would actually persist in macos /bin/sh
15791571
unset ZSTD_NBTHREADS
15801572
rm -f mt_tmp*

0 commit comments

Comments
 (0)