[sheepdog] [PATCH 14/14] sha1: force inline rol()

MORITA Kazutaka morita.kazutaka at gmail.com
Sat Aug 10 17:58:55 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

rol (rotate a 32-bit value left) is called a lot of times for each
sha1 calculation, and it becomes a bottleneck when inline expansion is
turned off (with debug build) and tracer is enabled.  It's not so
important to profile the function, so let's inline it forcely.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/sha1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sha1.c b/lib/sha1.c
index 0497625..85db278 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -21,7 +21,7 @@
 #include "sha1.h"
 #include "util.h"
 
-static inline uint32_t rol(uint32_t value, uint32_t bits)
+static __always_inline uint32_t rol(uint32_t value, uint32_t bits)
 {
 	return (value << bits) | (value >> (32 - bits));
 }
-- 
1.7.9.5




More information about the sheepdog mailing list