]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Inline CHUNKCOPY and CHUNKUNROLL
authorCameron Cawley <ccawley2011@gmail.com>
Fri, 16 Feb 2024 16:43:49 +0000 (16:43 +0000)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 22 Feb 2024 19:20:42 +0000 (20:20 +0100)
This slightly decreases the shared library size on x86_64 when both SSE2 and SSSE3 are enabled.

chunkset_tpl.h

index 250fdc36d6450209435689594fc849fe98d2ac87..f5cc5c04506dfc20ce531d75e8e889cb9e75a6b1 100644 (file)
@@ -25,7 +25,7 @@ Z_INTERNAL uint32_t CHUNKSIZE(void) {
    without iteration, which will hopefully make the branch prediction more
    reliable. */
 #ifndef HAVE_CHUNKCOPY
-Z_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
+static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
     Assert(len > 0, "chunkcopy should never have a length 0");
     chunk_t chunk;
     int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
@@ -54,7 +54,7 @@ Z_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
    least 258 bytes of output space available (258 being the maximum length
    output from a single token; see inflate_fast()'s assumptions below). */
 #ifndef HAVE_CHUNKUNROLL
-Z_INTERNAL uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
+static inline uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
     unsigned char const *from = out - *dist;
     chunk_t chunk;
     while (*dist < *len && *dist < sizeof(chunk_t)) {