From 49ed72cef4cfaeb721f10fc18e45056b0129f3e0 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 4 Jun 2019 21:20:52 -0400 Subject: [PATCH] [core] mark some more funcs w/ __attribute_pure__ --- src/http_header.h | 1 + src/stat_cache.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/http_header.h b/src/http_header.h index f19d1d96..0c82f44e 100644 --- a/src/http_header.h +++ b/src/http_header.h @@ -39,6 +39,7 @@ enum http_header_e { ,HTTP_HEADER_X_FORWARDED_PROTO = 0x04000000 }; +__attribute_pure__ enum http_header_e http_header_hkey_get(const char *s, size_t slen); buffer * http_header_response_get(connection *con, enum http_header_e id, const char *k, size_t klen); diff --git a/src/stat_cache.c b/src/stat_cache.c index eeef8d29..4e7ebf37 100644 --- a/src/stat_cache.c +++ b/src/stat_cache.c @@ -53,6 +53,7 @@ typedef struct stat_cache { /* the famous DJB hash function for strings */ +__attribute_pure__ static uint32_t djbhash(const char *str, const size_t len) { const unsigned char * const s = (const unsigned char *)str; @@ -62,6 +63,7 @@ static uint32_t djbhash(const char *str, const size_t len) } +__attribute_pure__ static uint32_t hashme(const char *str, const size_t len) { /* strip highest bit of hash value for splaytree */