From 011afa4be8fc0fab41906d4c1f70b960f80ee264 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 15 Oct 2011 23:41:31 +0200 Subject: [PATCH] fix: ubiquitous constant defined in header ..resulting in that global constant being allocated a gazillion times --- src/lib/symbol-impl.cpp | 3 +++ src/lib/symbol.hpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/symbol-impl.cpp b/src/lib/symbol-impl.cpp index 9e09b4254..7edabf2a8 100644 --- a/src/lib/symbol-impl.cpp +++ b/src/lib/symbol-impl.cpp @@ -50,6 +50,9 @@ using boost::hash_combine; namespace lib { + const size_t STRING_MAX_RELEVANT = 1000; + + /** equality on Symbol values is defined * based on the content, not the address. */ bool diff --git a/src/lib/symbol.hpp b/src/lib/symbol.hpp index 5c1f4d298..c032a3b95 100644 --- a/src/lib/symbol.hpp +++ b/src/lib/symbol.hpp @@ -112,7 +112,7 @@ namespace lib { /** safety guard: maximum number of chars to process. * For comparisons, hash calculations etc., when dealing * with raw char ptrs (typically literal values) */ - const size_t STRING_MAX_RELEVANT = 1000; + extern const size_t STRING_MAX_RELEVANT; /* ===== to be picked up by ADL ===== */