]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: xxhash: use the XXH_INLINE_ALL macro to inline all functions
authorDragan Dosen <ddosen@haproxy.com>
Tue, 22 Dec 2020 13:46:47 +0000 (14:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Dec 2020 05:39:21 +0000 (06:39 +0100)
This way we make all xxhash functions inline, with implementations being
directly included within xxhash.h.

Makefile is updated as well, since we don't need to compile and link
xxhash.o anymore.

Inlining should improve performance on small data inputs.

Makefile
include/haproxy/defaults.h
include/import/xxhash.h

index 95d52cac7593c8f73338e1b992752d11adfa62ec..6bfbbf92dc4e767239e54f23d0f7218b70244f8f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -847,7 +847,7 @@ OBJS += src/mux_h2.o src/mux_fcgi.o src/http_ana.o src/stream.o                \
         src/mworker-prog.o src/signal.o src/proto_udp.o src/lb_map.o           \
         src/sock_inet.o src/ev_select.o src/cfgparse-tcp.o                     \
         src/action.o src/thread.o src/sha1.o src/ebmbtree.o                    \
-        src/cfgparse-unix.o src/dict.o src/xxhash.o src/time.o                 \
+        src/cfgparse-unix.o src/dict.o src/time.o                              \
         src/hpack-dec.o src/arg.o src/hpack-tbl.o src/eb64tree.o               \
         src/chunk.o src/shctx.o src/regex.o src/fcgi.o src/eb32tree.o          \
         src/eb32sctree.o src/dynbuf.o src/pipe.o src/lru.o                     \
index ae4def1ffc89dc85304a6a36b168064d1e2ce52f..6a8b03de28b6d50aae19cdec1508fbade3d8b881 100644 (file)
 #define MAX_POLLERS    10
 #endif
 
+/* Make all xxhash functions inline, with implementations being directly
+ * included within xxhash.h.
+ */
+#ifndef XXH_INLINE_ALL
+#define XXH_INLINE_ALL
+#endif
+
 #endif /* _HAPROXY_DEFAULTS_H */
index 2d56d23c5d0beac4c1a4cab22da660674d0e0080..074ad03567359a4269ca22e9921651258e6a6e92 100644 (file)
@@ -75,6 +75,8 @@ XXH32        6.8 GB/s            6.0 GB/s
 extern "C" {
 #endif
 
+#include <haproxy/defaults.h>
+
 /* ****************************
  *  INLINE mode
  ******************************/