]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Make GZBUFSIZE and BUFLEN configurable.
authorNathan Moinvaziri <nathan@nathanm.com>
Sun, 29 Mar 2020 19:16:34 +0000 (12:16 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 16 Apr 2020 11:08:05 +0000 (13:08 +0200)
CMakeLists.txt
gzguts.h
test/minigzip.c

index 608a4c6b5b5e0547b88ac6661694c643113179b0..3feebec08236a24020decf08ded7f6001a865c89 100644 (file)
@@ -689,6 +689,7 @@ if(WITH_OPTIM)
     elseif(BASEARCH_S360_FOUND AND "${ARCH}" MATCHES "s390x")
         if(WITH_DFLTCC_DEFLATE OR WITH_DFLTCC_INFLATE)
             list(APPEND ZLIB_ARCH_SRCS ${ARCHDIR}/dfltcc_common.c)
+            add_definitions(-DGZBUFSIZE=262144)
         endif()
         if(WITH_DFLTCC_DEFLATE)
             add_definitions(-DS390_DFLTCC_DEFLATE)
@@ -936,6 +937,11 @@ if (ZLIB_ENABLE_TESTS)
     else()
         target_link_libraries(minigzip zlib)
     endif()
+    if(BASEARCH_S360_FOUND AND "${ARCH}" MATCHES "s390x")
+        if(WITH_DFLTCC_DEFLATE OR WITH_DFLTCC_INFLATE)
+            set_source_files_properties(test/minigzip.c PROPERTIES COMPILE_DEFINITIONS BUFLEN=262144)
+        endif()
+    endif()
 
     add_executable(switchlevels test/switchlevels.c)
     configure_test_executable(switchlevels)
index 0529a70a77d7ee9362dea889f9262e3743c62a81..83440d52c47ccfb9239fea98a5d8ff2644cca4f2 100644 (file)
--- a/gzguts.h
+++ b/gzguts.h
@@ -98,9 +98,7 @@
 
 /* default i/o buffer size -- double this for output when reading (this and
    twice this must be able to fit in an unsigned type) */
-#if defined(S390_DFLTCC_DEFLATE) || defined(S390_DFLTCC_INFLATE)
-#  define GZBUFSIZE 262144  /* DFLTCC works faster with larger buffers */
-#else
+#ifndef GZBUFSIZE
 #  define GZBUFSIZE 8192
 #endif
 
index ce7bae2d02a258e89005fa1d0dc9d75fe0ed8aca..6dc02599ca3827f20c3271fdf6d891dc2ccf7193 100644 (file)
@@ -59,9 +59,7 @@ extern int unlink (const char *);
 #endif
 #define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
 
-#if defined(S390_DFLTCC_DEFLATE) || defined(S390_DFLTCC_INFLATE)
-#  define BUFLEN      262144     /* DFLTCC works faster with larger buffers */
-#else
+#ifndef BUFLEN
 #  define BUFLEN      16384      /* read buffer size */
 #endif
 #define BUFLENW     (BUFLEN * 3) /* write buffer size */