1
0
mirror of https://github.com/facebook/zstd.git synced 2024-12-12 13:25:34 +02:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Yann Collet
011b3ca731
Merge f4a4f65f4c into 82d470564d 2024-12-03 12:21:20 +01:00
Yann Collet
82d470564d
Merge pull request #4201 from rorosen/seek-table-create-null-check
prevent possible segfault when creating seek table
2024-11-26 17:59:42 -08:00
Yann Collet
2b36d4bc1c
Merge pull request #4202 from nhz2/fix-compressBound-typo
Fix typo in ZSTD_compressBound docs
2024-11-26 17:59:25 -08:00
Yann Collet
7f11e6d2b6
Merge pull request #4205 from DimitriPapadopoulos/codespell
Fix new typos found by codespell
2024-11-26 09:59:25 -08:00
Dimitri Papadopoulos
fcf88ae39b
Fix new typos found by codespell 2024-11-26 11:15:39 +01:00
Yann Collet
1958fff050
Merge pull request #4199 from jimis/fix_filesize_print
Fix printing of filesize if >4GB
2024-11-25 08:54:11 -08:00
Robert Rose
b683c0dbe2 prevent possible segfault when creating seek table
Add a check whether the seek table of a `ZSTD_seekable` is initialized
before creating a new seek table from it. Return `NULL`, if the check
fails.
2024-11-25 08:57:25 +01:00
nhz2
10beb7cb53 Fix typo in ZSTD_compressBound docs 2024-11-24 19:05:15 -05:00
Dimitrios Apostolou
194062a4e7 Fix printing of filesize if >4GB 2024-11-20 16:11:17 +01:00
Yann Collet
f4a4f65f4c fixed path 2024-01-28 18:38:53 -08:00
Yann Collet
c768c600ad cmake: no need for CXX compiler 2024-01-28 18:25:08 -08:00
Yann Collet
ba8ff52970 fix cmake test on Solaris
write the recipe directly in the .yml file

For some reason, SolarisOS is not considered posix by the Makefile (?)
2024-01-28 17:40:32 -08:00
Yann Collet
5f18da53ad add a Solaris VM test
to Github Actions CI
2024-01-28 17:10:47 -08:00
9 changed files with 67 additions and 7 deletions

55
.github/workflows/solaris.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Run Solaris tests
# This test runs within a Solaris VM.
# It is very slow.
# Consequently, we only want to run it on demand.
# The trigger is the feature branch name.
on:
push:
branches:
- '*sun*'
- '*Sun*'
- '*solaris*'
- '*Solaris*'
jobs:
test:
runs-on: ubuntu-latest
name: solaris-vm test
env:
EX_TOKEN: "ex_value"
steps:
- uses: actions/checkout@v4
- name: Test in Solaris
id: test
uses: vmactions/solaris-vm@v1.0.1
with:
envs: 'EX_TOKEN'
usesh: true
prepare: |
pkgutil -y -i socat
release: "11.4-gcc"
run: |
if [ -n "test" ]; then
echo "false"
fi
if [ "test" ]; then
echo "test"
fi
pwd
ls -lah
whoami
env
psrinfo -vp
cat /etc/release
psrinfo -v
echo "::memstat" | mdb -k
gcc -v
CC=gcc CFLAGS="-Werror -O1" gmake -j check
pkg install cmake
cmake --version
rm -rf cmakebuild install
mkdir -p cmakebuild install
cd cmakebuild; cmake -Wdev -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror -O0" -DCMAKE_INSTALL_PREFIX=install ../build/cmake; cd ..
cmake --build cmakebuild --target install -- -j V=1

View File

@ -34,7 +34,6 @@ project(zstd
VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}"
LANGUAGES C # Main library is in C
ASM # And ASM
CXX # Testing contributed code also utilizes CXX
)
message(STATUS "ZSTD VERSION: ${zstd_VERSION}")

View File

@ -51,7 +51,7 @@ function(EnableCompilerFlag _flag _C _CXX _LD)
endfunction()
macro(ADD_ZSTD_COMPILATION_FLAGS)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) # Not only UNIX but also WIN32 for MinGW
# It's possible to select the exact standard used for compilation.
# It's not necessary, but can be employed for specific purposes.
# Note that zstd source code is compatible with both C++98 and above

View File

@ -7,7 +7,11 @@
# in the COPYING file in the root directory of this source tree).
# ################################################################
project(contrib)
project(contrib
LANGUAGES C # Main library is in C
ASM # And ASM
CXX # pzstd, gen_html
)
add_subdirectory(pzstd)
add_subdirectory(gen_html)

View File

@ -252,6 +252,8 @@ size_t ZSTD_seekable_free(ZSTD_seekable* zs)
ZSTD_seekTable* ZSTD_seekTable_create_fromSeekable(const ZSTD_seekable* zs)
{
assert(zs != NULL);
if (zs->seekTable.entries == NULL) return NULL;
ZSTD_seekTable* const st = (ZSTD_seekTable*)malloc(sizeof(ZSTD_seekTable));
if (st==NULL) return NULL;

View File

@ -1120,7 +1120,7 @@ For the purpose of counting total allocated probability points, it counts as one
Symbols probabilities are read one by one, in order.
After each probability is decoded, the total nb of probability points is updated.
This is used to dermine how many bits must be read to decode the probability of next symbol.
This is used to determine how many bits must be read to decode the probability of next symbol.
When a symbol has a __probability__ of `zero` (decoded from reading a Value `1`),
it is followed by a 2-bits repeat flag.

View File

@ -75,7 +75,7 @@ unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
const void* src, size_t srcSize);
/*! HIST_add() :
* Lowest level: just add nb of occurences of characters from @src into @count.
* Lowest level: just add nb of occurrences of characters from @src into @count.
* @count is not reset. @count array is presumed large enough (i.e. 1 KB).
@ This function does not need any additional stack memory.
*/

View File

@ -224,7 +224,7 @@ ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize)
* it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize)
* as it eliminates one potential failure scenario,
* aka not enough room in dst buffer to write the compressed frame.
* Note : ZSTD_compressBound() itself can fail, if @srcSize > ZSTD_MAX_INPUT_SIZE .
* Note : ZSTD_compressBound() itself can fail, if @srcSize >= ZSTD_MAX_INPUT_SIZE .
* In which case, ZSTD_compressBound() will return an error code
* which can be tested using ZSTD_isError().
*

View File

@ -696,7 +696,7 @@ static void printDefaultCParams(const char* filename, const char* dictFileName,
unsigned long long fileSize = UTIL_getFileSize(filename);
const size_t dictSize = dictFileName != NULL ? (size_t)UTIL_getFileSize(dictFileName) : 0;
const ZSTD_compressionParameters cParams = ZSTD_getCParams(cLevel, fileSize, dictSize);
if (fileSize != UTIL_FILESIZE_UNKNOWN) DISPLAY("%s (%u bytes)\n", filename, (unsigned)fileSize);
if (fileSize != UTIL_FILESIZE_UNKNOWN) DISPLAY("%s (%llu bytes)\n", filename, fileSize);
else DISPLAY("%s (src size unknown)\n", filename);
DISPLAY(" - windowLog : %u\n", cParams.windowLog);
DISPLAY(" - chainLog : %u\n", cParams.chainLog);