From: Nathan Moinvaziri Date: Sun, 29 Mar 2020 19:16:34 +0000 (-0700) Subject: Make GZBUFSIZE and BUFLEN configurable. X-Git-Tag: 1.9.9-b1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d14fae1860972bb4899c0689838215778afdbbd9;p=thirdparty%2Fzlib-ng.git Make GZBUFSIZE and BUFLEN configurable. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 608a4c6b5..3feebec08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/gzguts.h b/gzguts.h index 0529a70a7..83440d52c 100644 --- 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 diff --git a/test/minigzip.c b/test/minigzip.c index ce7bae2d0..6dc02599c 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -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 */