From: Yann Collet Date: Wed, 6 Jun 2018 19:47:16 +0000 (-0700) Subject: better make -j all behavior X-Git-Tag: v1.3.5~3^2~31^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=830fd4468f099358fb370e00f2b25ac0c0159043;p=thirdparty%2Fzstd.git better make -j all behavior avoid concurrent compilation of libzstd --- diff --git a/Makefile b/Makefile index 5756e630c..4f515bb95 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ endif default: lib-release zstd-release .PHONY: all -all: | allmost examples manual contrib +all: allmost examples manual contrib .PHONY: allmost allmost: allzstd @@ -35,8 +35,7 @@ allmost: allzstd #skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd -allzstd: - $(MAKE) -C $(ZSTDDIR) all +allzstd: lib $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -45,24 +44,15 @@ all32: $(MAKE) -C $(PRGDIR) zstd32 $(MAKE) -C $(TESTDIR) all32 -.PHONY: lib -lib: +.PHONY: lib lib-release +lib lib-release: @$(MAKE) -C $(ZSTDDIR) $@ -.PHONY: lib-release -lib-release: - @$(MAKE) -C $(ZSTDDIR) - -.PHONY: zstd -zstd: +.PHONY: zstd zstd-release +zstd zstd-release: @$(MAKE) -C $(PRGDIR) $@ cp $(PRGDIR)/zstd$(EXT) . -.PHONY: zstd-release -zstd-release: - @$(MAKE) -C $(PRGDIR) - cp $(PRGDIR)/zstd$(EXT) . - .PHONY: zstdmt zstdmt: @$(MAKE) -C $(PRGDIR) $@ @@ -85,7 +75,7 @@ shortest: check: shortest .PHONY: examples -examples: +examples: lib CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all .PHONY: manual diff --git a/doc/zstd_manual.html b/doc/zstd_manual.html index aae6d0f37..3d107746b 100644 --- a/doc/zstd_manual.html +++ b/doc/zstd_manual.html @@ -82,7 +82,7 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);

`src` should point to the start of a ZSTD encoded frame. `srcSize` must be at least as large as the frame header. hint : any size >= `ZSTD_frameHeaderSize_max` is large enough. - @return : - decompressed size of the frame in `src`, if known + @return : - decompressed size of `src` frame content, if known - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) note 1 : a 0 return value means the frame is valid but "empty". @@ -92,7 +92,8 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize); Optionally, application can rely on some implicit limit, as ZSTD_decompress() only needs an upper bound of decompressed size. (For example, data could be necessarily cut into blocks <= 16 KB). - note 3 : decompressed size is always present when compression is done with ZSTD_compress() + note 3 : decompressed size is always present when compression is completed using single-pass functions, + such as ZSTD_compress(), ZSTD_compressCCtx() ZSTD_compress_usingDict() or ZSTD_compress_usingCDict(). note 4 : decompressed size can be very large (64-bits value), potentially larger than what local system can handle as a single memory segment. In which case, it's necessary to use streaming mode to decompress data. @@ -107,8 +108,7 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize); Both functions work the same way, but ZSTD_getDecompressedSize() blends "empty", "unknown" and "error" results to the same return value (0), while ZSTD_getFrameContentSize() gives them separate return values. - `src` is the start of a zstd compressed frame. - @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. + @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise.


Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */