Rohit Jain
f881ee8c48
Moving code to util.c
2018-10-11 14:38:41 -07:00
Yann Collet
b304b679e5
use #if BACKTRACE_ENABLE directly
...
as suggested by @terrelln
2018-10-09 17:56:59 -07:00
Julian Fessard
0ea286f740
Merge branch 'backtrace' of github.com:facebook/zstd into backtrace
2018-10-09 17:24:48 -07:00
Julian Fessard
70d8c2a031
fileio.c: Disable backtrace when built with address sanitizer
...
Covers clang and gcc's sanitizer flags.
Can still be overridden through CFLAGS on commandline.
2018-10-09 17:14:57 -07:00
Yann Collet
e0ab6b61b7
fixed explicit BACKTRACE order
...
and automatic linux backtrace detection :
__GLIBC__ must be tested after #include <features.h>
2018-10-09 17:12:21 -07:00
Yann Collet
1e0c5466c5
fixed BACKTRACE_ENABLE macro test
2018-10-09 16:36:57 -07:00
Yann Collet
f17c1df1ac
backtrace support compiled with more conditions
...
following #1356 ,
only enable backtrace compilation on linux+glibc.
Also, disable backtrace by default from "release" compilation,
so that less platforms get impacted by the new requirements.
Can be manually enabled/disabled using BACKTRACE=1/0.
2018-10-08 17:03:06 -07:00
maxice8
1d75697d9b
don't assume __linux__ means __GLIBC__ on BACKTRACES_ENABLE
...
check for __GLIBC__ instead of __linux__ as musl libc doesn't provide
execinfo.h
fixes compilation on Alpine Linux and Void Linux musl arches.
2018-10-05 21:23:45 -03:00
Yann Collet
0854b06d1b
Merge pull request #1351 from facebook/haikubuild
...
portability macro flags updates, for Haiku
2018-10-04 14:59:35 -07:00
Yann Collet
efbc3e823d
fixed paramgrill wrong assert() conditions
...
and slightly refactored affected function.
Honestly, the formula calculating variance should get a second reviewing round,
it's not clear if it's correct.
2018-10-04 14:27:13 -07:00
Yann Collet
4a85b126d9
changed ZSTD_NANOSLEEP_SUPPORT definition
...
to please `-Wexpansion-to-defined`
2018-10-03 15:34:41 -07:00
Yann Collet
549c19b42e
portability macro flags updates, for Haiku
...
some non-trivial changes to platform.h and util.h,
initially related to compilation for Haiku,
but I used this opportunity to make them cleaner
and add some documentation.
Noticed several tests that could be improved
(too harsh conditions, useless exception, etc.)
but I did not dare modifying too many tests just before release.
2018-10-03 14:56:46 -07:00
Yann Collet
bc93b801f0
Merge pull request #1330 from korli/haiku
...
Enable building zstd on Haiku.
2018-10-03 13:36:00 -07:00
Yann Collet
b1407f9acd
fixed wrong assert() position
...
could fire on invalid input.
blocking for afl tests.
2018-10-03 12:43:59 -07:00
Jerome Duval
87c10e2f58
Enable building zstd on Haiku.
2018-10-03 09:51:56 +02:00
Yann Collet
c9843ec232
Merge pull request #1348 from facebook/donotdelete
...
Fix #1082
2018-10-02 16:37:58 -07:00
Yann Collet
3ca6261223
fixed static analyzer warnings
...
note : for some reason,
scan-build version on my laptop found problems within fastcover.c
that scan-build on travisCI does not flag.
They are, as usual, false positive :
the analyzer does not understand that a table (`offset`) is correctly filled before usage.
2018-10-02 15:59:11 -07:00
Yann Collet
d98733b37e
restored backtrace on failure
...
for Linux and Mac OS-X.
Note : the backtraces fires up through a trap
before the sanitizer get a chance to report.
There are situations where the sanitizer report is actually preferable.
It might be good to consider a kind of build macro
which can disable backtrace
when sanitizer is enabled.
2018-10-01 17:50:16 -07:00
Yann Collet
9012b6cba0
./zstd -f do no longer overwrite destination file
...
if source file does not exist (#1082 )
2018-10-01 17:16:34 -07:00
Yann Collet
c7bd6a41ab
zstd -d -f do no longer erase destination file
...
when source file does not exist (#1082 )
2018-10-01 14:04:00 -07:00
Yann Collet
1ab71a8e72
regroup name creation logic into its own function
...
for a cleaner main file decompression loop
2018-09-28 18:19:23 -07:00
Yann Collet
ec1cb8e996
changed macro name
...
from EXIT_IF() to RETURN_IF()
EXIT could be misunderstood as exit(), which terminates program execution.
But the macro only leaves the function, not the program.
2018-09-28 16:04:00 -07:00
Yann Collet
05c0a072b7
minor improvement in the multi-format suffix selection
2018-09-28 15:57:35 -07:00
Nick Terrell
09231dad4d
[util] Fix lstat feature test macro
2018-09-28 15:23:09 -07:00
Yann Collet
d987ab5983
fixed unreachable section warning on Visual
2018-09-28 09:34:16 -07:00
Yann Collet
913a0365b6
Merge branch 'dev' into donotdelete
2018-09-27 19:23:55 -07:00
Yann Collet
ef1272737b
fixed minor Visual conversion warnings
2018-09-27 18:29:15 -07:00
Yann Collet
9b45db7fa6
minor refactoring of --list
...
trying to reduce recurrent patterns.
2018-09-27 16:49:08 -07:00
Nick Terrell
f2d6db45cd
[zstd] Add -Wmissing-prototypes
2018-09-27 15:24:48 -07:00
Yann Collet
e74eade251
Merge pull request #1339 from facebook/grep_colors
...
fixed usage of grep in Makefile
2018-09-26 14:39:20 -07:00
Yann Collet
8883af6a1e
Merge pull request #1327 from facebook/adapt
...
Adaptive compression
2018-09-26 14:39:08 -07:00
Yann Collet
8ff17a6a09
Merge pull request #1329 from facebook/v04isout
...
Changed default legacy support to v0.5+
2018-09-26 13:39:05 -07:00
Yann Collet
08f68d83c5
fixed usage of grep in Makefile
...
when terminal uses colors
as suggested by @danielshir (#1294 )
2018-09-25 16:56:53 -07:00
Yann Collet
6c51bf420c
bounds for --adapt mode
...
can supply min and max compression level through advanced command :
--adapt=min=#,max=#
2018-09-25 16:03:28 -07:00
Yann Collet
04f47bbdd2
Merge branch 'dev' into adapt
2018-09-24 16:56:45 -07:00
Yann Collet
9bb6c15f79
Merge pull request #1332 from facebook/minclevel
...
defined a minimum negative level
2018-09-24 16:01:13 -07:00
Yann Collet
0250ac74ce
fixed minor scan-build warnings
2018-09-24 00:52:19 -07:00
Yann Collet
0fc07eb1fd
fixed zstd-decompress
...
which cannot support ZSTD_minCLevel()
2018-09-22 17:21:39 -07:00
Yann Collet
364041c6dd
enforce minimum compression level limit
...
using ZSTD_minCLevel()
2018-09-22 16:10:10 -07:00
Yann Collet
00c18c0c88
simplified "slows down when compression blocked"
2018-09-21 16:35:43 -07:00
Yann Collet
c484345a82
Merge branch 'mingw' into adapt
2018-09-21 16:00:46 -07:00
Yann Collet
bfff4f4809
ensure all writes to job->cSize are mutex protected
...
even when reporting errors,
using a macro for code brevity, as suggested by @terrelln,
2018-09-21 16:00:39 -07:00
Yann Collet
32b7cf1bcf
fixed tautological tests
...
involving ZSTD_TARGETLENGTH_MIN (== 0)
2018-09-21 15:04:43 -07:00
Yann Collet
54001f3dbc
fix mingw compatibility
...
only enable backtraces for platforms we know support it
aka mac OS-X and Linux.
can be extended later.
2018-09-21 14:46:09 -07:00
Yann Collet
b2939163e1
Changed default legacy support to v0.5+
...
thus dropping read support for v0.4.
It's always possible to re-enable it, by changing build macro ZSTD_LEGACY_SUPPORT to 4.
2018-09-20 14:30:20 -07:00
Yann Collet
15519479ba
fixed minor gcc warning on a unused variable
2018-09-20 13:00:11 -07:00
Yann Collet
45010da074
updated man page
...
and added `--adapt` test in `playTests.sh`
2018-09-19 17:37:22 -07:00
Yann Collet
ca02ebee07
removed static variables
...
so that --adapt can work on multiple input files too
2018-09-19 15:25:50 -07:00
Yann Collet
89bc309d90
error out when --adapt is associated with --single-thread
...
since they are not compatible
2018-09-19 14:49:13 -07:00
Yann Collet
2f78228f65
Merge branch 'dev' into adapt
2018-09-19 12:43:42 -07:00