Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/zlib/pigz/dist pigz 2.3.1



details:   https://anonhg.NetBSD.org/src/rev/34771c15b055
branches:  trunk
changeset: 329965:34771c15b055
user:      tls <tls%NetBSD.org@localhost>
date:      Sun Jun 15 17:37:20 2014 +0000

description:
pigz 2.3.1

diffstat:

 external/zlib/pigz/dist/Makefile                |    60 +-
 external/zlib/pigz/dist/README                  |     8 +-
 external/zlib/pigz/dist/pigz.c                  |  2461 +++++++++++++++-------
 external/zlib/pigz/dist/pigz.pdf                |   Bin 
 external/zlib/pigz/dist/pigz.spec               |    59 +-
 external/zlib/pigz/dist/yarn.c                  |    18 +-
 external/zlib/pigz/dist/yarn.h                  |    10 +-
 external/zlib/pigz/dist/zopfli/CONTRIBUTORS     |     6 +
 external/zlib/pigz/dist/zopfli/COPYING          |   201 +
 external/zlib/pigz/dist/zopfli/README           |    24 +
 external/zlib/pigz/dist/zopfli/blocksplitter.c  |   344 +++
 external/zlib/pigz/dist/zopfli/blocksplitter.h  |    77 +
 external/zlib/pigz/dist/zopfli/cache.c          |   119 +
 external/zlib/pigz/dist/zopfli/cache.h          |    66 +
 external/zlib/pigz/dist/zopfli/deflate.c        |   705 ++++++
 external/zlib/pigz/dist/zopfli/deflate.h        |    77 +
 external/zlib/pigz/dist/zopfli/gzip_container.c |   117 +
 external/zlib/pigz/dist/zopfli/gzip_container.h |    42 +
 external/zlib/pigz/dist/zopfli/hash.c           |   135 +
 external/zlib/pigz/dist/zopfli/hash.h           |    70 +
 external/zlib/pigz/dist/zopfli/katajainen.c     |   251 ++
 external/zlib/pigz/dist/zopfli/katajainen.h     |    42 +
 external/zlib/pigz/dist/zopfli/lz77.c           |   468 ++++
 external/zlib/pigz/dist/zopfli/lz77.h           |   126 +
 external/zlib/pigz/dist/zopfli/makefile         |     5 +
 external/zlib/pigz/dist/zopfli/squeeze.c        |   543 +++++
 external/zlib/pigz/dist/zopfli/squeeze.h        |    60 +
 external/zlib/pigz/dist/zopfli/tree.c           |   101 +
 external/zlib/pigz/dist/zopfli/tree.h           |    51 +
 external/zlib/pigz/dist/zopfli/util.c           |   202 +
 external/zlib/pigz/dist/zopfli/util.h           |   175 +
 external/zlib/pigz/dist/zopfli/zlib_container.c |    79 +
 external/zlib/pigz/dist/zopfli/zlib_container.h |    42 +
 external/zlib/pigz/dist/zopfli/zopfli.h         |    71 +
 external/zlib/pigz/dist/zopfli/zopfli_bin.c     |   204 +
 external/zlib/pigz/dist/zopfli/zopfli_lib.c     |    34 +
 36 files changed, 6217 insertions(+), 836 deletions(-)

diffs (truncated from 8543 to 300 lines):

diff -r 5fe0d3d1342c -r 34771c15b055 external/zlib/pigz/dist/Makefile
--- a/external/zlib/pigz/dist/Makefile  Sun Jun 15 16:10:46 2014 +0000
+++ b/external/zlib/pigz/dist/Makefile  Sun Jun 15 17:37:20 2014 +0000
@@ -1,29 +1,49 @@
-CFLAGS=-O3
+CC=cc
+CFLAGS=-O3 -Wall -Wextra
 
-pigz: pigz.o yarn.o
-       cc -o pigz pigz.o yarn.o -lpthread -lz
+
+pigz: pigz.o yarn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
+       $(CC) $(LDFLAGS) -o pigz $^ -lpthread -lz -lm
        ln -f pigz unpigz
 
-pigz.o: pigz.c yarn.h
+pigz.o: pigz.c yarn.h zopfli/deflate.h zopfli/util.h
 
 yarn.o: yarn.c yarn.h
 
+zopfli/deflate.o: zopfli/deflate.c zopfli/deflate.h zopfli/blocksplitter.h zopfli/lz77.h zopfli/squeeze.h zopfli/tree.h zopfli/zopfli.h zopfli/cache.h zopfli/hash.h zopfli/util.h
+
+zopfli/blocksplitter.o: zopfli/blocksplitter.c zopfli/blocksplitter.h zopfli/deflate.h zopfli/lz77.h zopfli/squeeze.h zopfli/tree.h zopfli/util.h zopfli/zopfli.h zopfli/cache.h zopfli/hash.h
+
+zopfli/tree.o: zopfli/tree.c zopfli/tree.h zopfli/katajainen.h zopfli/util.h
+
+zopfli/lz77.o: zopfli/lz77.h zopfli/util.h zopfli/cache.h zopfli/hash.h zopfli/zopfli.h
+
+zopfli/cache.o: zopfli/cache.c zopfli/cache.h zopfli/util.h
+
+zopfli/hash.o: zopfli/hash.c zopfli/hash.h zopfli/util.h
+
+zopfli/util.o: zopfli/util.c zopfli/util.h
+
+zopfli/squeeze.o: zopfli/squeeze.c zopfli/squeeze.h zopfli/blocksplitter.h zopfli/deflate.h zopfli/tree.h zopfli/util.h zopfli/zopfli.h zopfli/lz77.h zopfli/cache.h zopfli/hash.h
+
+zopfli/katajainen.o: zopfli/katajainen.c zopfli/katajainen.h
+
 dev: pigz pigzt pigzn
 
-pigzt: pigzt.o yarnt.o
-       cc -o pigzt pigzt.o yarnt.o -lpthread -lz
+pigzt: pigzt.o yarnt.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
+       $(CC) $(LDFLAGS) -o pigzt $^ -lpthread -lz -lm
 
 pigzt.o: pigz.c yarn.h
-       cc -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c
+       $(CC) $(CFLAGS) -DDEBUG -g -c -o pigzt.o pigz.c
 
 yarnt.o: yarn.c yarn.h
-       cc -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c
+       $(CC) $(CFLAGS) -DDEBUG -g -c -o yarnt.o yarn.c
 
-pigzn: pigzn.o
-       cc -o pigzn pigzn.o -lz
+pigzn: pigzn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
+       $(CC) $(LDFLAGS) -o pigzn $^ -lz -lm
 
 pigzn.o: pigz.c
-       cc -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
+       $(CC) $(CFLAGS) -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
 
 test: pigz
        ./pigz -kf pigz.c ; ./pigz -t pigz.c.gz
@@ -31,12 +51,22 @@
        ./pigz -kfp 1 pigz.c ; ./pigz -t pigz.c.gz
        ./pigz -kfz pigz.c ; ./pigz -t pigz.c.zz
        ./pigz -kfK pigz.c ; ./pigz -t pigz.c.zip
-       compress -f < pigz.c | ./unpigz | cmp - pigz.c
-       rm -f pigz.c.gz pigz.c.zz pigz.c.zip
+       printf "" | ./pigz -cdf | wc -c | test `cat` -eq 0
+       printf "x" | ./pigz -cdf | wc -c | test `cat` -eq 1
+       printf "xy" | ./pigz -cdf | wc -c | test `cat` -eq 2
+       printf "xyz" | ./pigz -cdf | wc -c | test `cat` -eq 3
+       (printf "w" | gzip ; printf "x") | ./pigz -cdf | wc -c | test `cat` -eq 2
+       (printf "w" | gzip ; printf "xy") | ./pigz -cdf | wc -c | test `cat` -eq 3
+       (printf "w" | gzip ; printf "xyz") | ./pigz -cdf | wc -c | test `cat` -eq 4
+       -@if test "`whereis compress | grep /`" != ""; then \
+         echo 'compress -f < pigz.c | ./unpigz | cmp - pigz.c' ;\
+         compress -f < pigz.c | ./unpigz | cmp - pigz.c ;\
+       fi
+       @rm -f pigz.c.gz pigz.c.zz pigz.c.zip
 
 tests: dev test
        ./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz
-       rm -f pigz.c.gz
+       @rm -f pigz.c.gz
 
 docs: pigz.pdf
 
@@ -44,4 +74,4 @@
        groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf
 
 clean:
-       rm -f *.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip
+       @rm -f *.o zopfli/*.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip
diff -r 5fe0d3d1342c -r 34771c15b055 external/zlib/pigz/dist/README
--- a/external/zlib/pigz/dist/README    Sun Jun 15 16:10:46 2014 +0000
+++ b/external/zlib/pigz/dist/README    Sun Jun 15 17:37:20 2014 +0000
@@ -1,4 +1,4 @@
-pigz 2.1.6 (17 Jan 2010) by Mark Adler
+pigz 2.3.1 (9 Oct 2013) by Mark Adler
 
 pigz, which stands for Parallel Implementation of GZip, is a fully functional
 replacement for gzip that exploits multiple processors and multiple cores to
@@ -14,8 +14,10 @@
 Type "pigz" to see the command help and all of the command options.
 
 The latest version of pigz can be found at http://zlib.net/pigz/ .  You need
-zlib version 1.2.3 or later to compile pigz.  You can find the latest version
-of zlib at http://zlib.net/ .  You can look in pigz.c for the change history.
+zlib version 1.2.3 or later to compile pigz.  zlib version 1.2.6 or later is
+recommended, which reduces the overhead between blocks.  You can find the
+latest version of zlib at http://zlib.net/ .  You can look in pigz.c for the
+change history.
 
 Questions, comments, bug reports, fixes, etc. can be emailed to Mark at his
 address in the license below.
diff -r 5fe0d3d1342c -r 34771c15b055 external/zlib/pigz/dist/pigz.c
--- a/external/zlib/pigz/dist/pigz.c    Sun Jun 15 16:10:46 2014 +0000
+++ b/external/zlib/pigz/dist/pigz.c    Sun Jun 15 17:37:20 2014 +0000
@@ -1,6 +1,6 @@
 /* pigz.c -- parallel implementation of gzip
- * Copyright (C) 2007, 2008, 2009, 2010 Mark Adler
- * Version 2.1.6  17 Jan 2010  Mark Adler
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Mark Adler
+ * Version 2.3.1  9 Oct 2013  Mark Adler
  */
 
 /*
@@ -47,7 +47,7 @@
                        Implement all command line options except --recursive
                        Add --keep option to prevent deleting input files
                        Add thread tracing information with -vv used
-                       Copy crc32_combine() from zlib (possible thread issue)
+                       Copy crc32_combine() from zlib (shared libraries issue)
    1.3    25 Feb 2007  Implement --recursive
                        Expand help to show all options
                        Show help if no arguments or output piping are provided
@@ -106,15 +106,69 @@
                        Decompress if executable named "gunzip" [Hoffstätte]
                        Allow ".tgz" suffix [Chernookiy]
                        Fix adler32 comparison on .zz files
+   2.1.7  17 Dec 2011  Avoid unused parameter warning in reenter()
+                       Don't assume 2's complement ints in compress_thread()
+                       Replicate gzip -cdf cat-like behavior
+                       Replicate gzip -- option to suppress option decoding
+                       Test output from make test instead of showing it
+                       Updated pigz.spec to install unpigz, pigz.1 [Obermaier]
+                       Add PIGZ environment variable [Mueller]
+                       Replicate gzip suffix search when decoding or listing
+                       Fix bug in load() to set in_left to zero on end of file
+                       Do not check suffix when input file won't be modified
+                       Decompress to stdout if name is "*cat" [Hayasaka]
+                       Write data descriptor signature to be like Info-ZIP
+                       Update and sort options list in help
+                       Use CC variable for compiler in Makefile
+                       Exit with code 2 if a warning has been issued
+                       Fix thread synchronization problem when tracing
+                       Change macro name MAX to MAX2 to avoid library conflicts
+                       Determine number of processors on HP-UX [Lloyd]
+   2.2    31 Dec 2011  Check for expansion bound busting (e.g. modified zlib)
+                       Make the "threads" list head global variable volatile
+                       Fix construction and printing of 32-bit check values
+                       Add --rsyncable functionality
+   2.2.1   1 Jan 2012  Fix bug in --rsyncable buffer management
+   2.2.2   1 Jan 2012  Fix another bug in --rsyncable buffer management
+   2.2.3  15 Jan 2012  Remove volatile in yarn.c
+                       Reduce the number of input buffers
+                       Change initial rsyncable hash to comparison value
+                       Improve the efficiency of arriving at a byte boundary
+                       Add thread portability #defines from yarn.c
+                       Have rsyncable compression be independent of threading
+                       Fix bug where constructed dictionaries not being used
+   2.2.4  11 Mar 2012  Avoid some return value warnings
+                       Improve the portability of printing the off_t type
+                       Check for existence of compress binary before using
+                       Update zlib version checking to 1.2.6 for new functions
+                       Fix bug in zip (-K) output
+                       Fix license in pigz.spec
+                       Remove thread portability #defines in pigz.c
+   2.2.5  28 Jul 2012  Avoid race condition in free_pool()
+                       Change suffix to .tar when decompressing or listing .tgz
+                       Print name of executable in error messages
+                       Show help properly when the name is unpigz or gunzip
+                       Fix permissions security problem before output is closed
+   2.3     3 Mar 2013  Don't complain about missing suffix on stdout
+                       Put all global variables in a structure for readability
+                       Do not decompress concatenated zlib streams (just gzip)
+                       Add option for compression level 11 to use zopfli
+                       Fix handling of junk after compressed data
+   2.3.1   9 Oct 2013  Fix builds of pigzt and pigzn to include zopfli
+                       Add -lm, needed to link log function on some systems
+                       Respect LDFLAGS in Makefile, use CFLAGS consistently
+                       Add memory allocation tracking
+                       Fix casting error in uncompressed length calculation
+                       Update zopfli to Mar 10, 2013 Google state
+                       Support zopfli in single thread case
+                       Add -F, -I, -M, and -O options for zopfli tuning
  */
 
-#define VERSION "pigz 2.1.6\n"
+#define VERSION "pigz 2.3.1\n"
 
 /* To-do:
-    - add --rsyncable (or -R) [use my own algorithm, set min/max block size]
     - make source portable for Windows, VMS, etc. (see gzip source code)
     - make build portable (currently good for Unixish)
-    - add bzip2 decompression
  */
 
 /*
@@ -132,9 +186,11 @@
 
    Each partial raw deflate stream is terminated by an empty stored block
    (using the Z_SYNC_FLUSH option of zlib), in order to end that partial bit
-   stream at a byte boundary.  That allows the partial streams to be
-   concatenated simply as sequences of bytes.  This adds a very small four to
-   five byte overhead to the output for each input chunk.
+   stream at a byte boundary, unless that partial stream happens to already end
+   at a byte boundary (the latter requires zlib 1.2.6 or later).  Ending on a
+   byte boundary allows the partial streams to be concatenated simply as
+   sequences of bytes.  This adds a very small four to five byte overhead
+   (average 3.75 bytes) to the output for each input chunk.
 
    The default input block size is 128K, but can be changed with the -b option.
    The number of compress threads is set by default to 8, which can be changed
@@ -190,10 +246,10 @@
    jobs until instructed to return.  When a job is pulled, the dictionary, if
    provided, will be loaded into the deflate engine and then that input buffer
    is dropped for reuse.  Then the input data is compressed into an output
-   buffer sized to assure that it can contain maximally expanded deflate data.
-   The job is then put into the write job list, sorted by the sequence number.
-   The compress thread however continues to calculate the check value on the
-   input data, either a CRC-32 or Adler-32, possibly in parallel with the write
+   buffer that grows in size if necessary to hold the compressed data. The job
+   is then put into the write job list, sorted by the sequence number. The
+   compress thread however continues to calculate the check value on the input
+   data, either a CRC-32 or Adler-32, possibly in parallel with the write
    thread writing the output data.  Once that's done, the compress thread drops
    the input buffer and also releases the lock on the check value so that the
    write thread can combine it with the previous check values.  The compress
@@ -237,7 +293,7 @@
    to compression, that number allows a second set of buffers to be read while
    the first set of compressions are being performed.  The number of output
    buffers is not directly limited, but is indirectly limited by the release of
-   input buffers to the same number.
+   input buffers to about the same number.
  */
 
 /* use large file functions if available */
@@ -266,7 +322,30 @@
                         /* O_WRONLY */
 #include <dirent.h>     /* opendir(), readdir(), closedir(), DIR, */
                         /* struct dirent */
-#include <limits.h>     /* PATH_MAX */
+#include <limits.h>     /* PATH_MAX, UINT_MAX, INT_MAX */
+#if __STDC_VERSION__-0 >= 199901L || __GNUC__-0 >= 3
+#  include <inttypes.h> /* intmax_t */
+#endif
+
+#ifdef DEBUG
+#  if defined(__APPLE__)
+#    include <malloc/malloc.h>
+#    define MALLOC_SIZE(p) malloc_size(p)
+#  elif defined (__linux)
+#    include <malloc.h>
+#    define MALLOC_SIZE(p) malloc_usable_size(p)
+#  elif defined (_WIN32) || defined(_WIN64)
+#    include <malloc.h>
+#    define MALLOC_SIZE(p) _msize(p)
+#  else
+#    define MALLOC_SIZE(p) (0)
+#  endif
+#endif
+
+#ifdef __hpux
+#  include <sys/param.h>
+#  include <sys/pstat.h>
+#endif
 
 #include "zlib.h"       /* deflateInit2(), deflateReset(), deflate(), */
                         /* deflateEnd(), deflateSetDictionary(), crc32(),
@@ -283,6 +362,8 @@
                         /* lock, new_lock(), possess(), twist(), wait_for(),
                            release(), peek_lock(), free_lock(), yarn_name */
 #endif
+#include "zopfli/deflate.h"     /* ZopfliDeflatePart(), ZopfliInitOptions(),
+                                   ZopfliOptions */
 
 /* for local functions and globals */
 #define local static
@@ -299,55 +380,260 @@
 #define RELEASE(ptr) \
     do { \
         if ((ptr) != NULL) { \
-            free(ptr); \
+            FREE(ptr); \
             ptr = NULL; \
         } \



Home | Main Index | Thread Index | Old Index