diff options
| author | Cameron Cawley <ccawley2011@gmail.com> | 2024-02-16 16:43:49 +0000 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2024-02-22 20:20:42 +0100 |
| commit | 7cca3e6fd75510065dcc7a1e7b0f85402343ede9 (patch) | |
| tree | 226bf66955abc53ade25181eb473553ef44cb169 | |
| parent | d745a9bc24e523853de36a4206d8e04acd3c67c7 (diff) | |
| download | Project-Tick-7cca3e6fd75510065dcc7a1e7b0f85402343ede9.tar.gz Project-Tick-7cca3e6fd75510065dcc7a1e7b0f85402343ede9.zip | |
Inline CHUNKCOPY and CHUNKUNROLL
This slightly decreases the shared library size on x86_64 when both SSE2 and SSSE3 are enabled.
| -rw-r--r-- | chunkset_tpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chunkset_tpl.h b/chunkset_tpl.h index 250fdc36d6..f5cc5c0450 100644 --- a/chunkset_tpl.h +++ b/chunkset_tpl.h @@ -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)) { |
