Skip to content

Commit

Permalink
Deduplicate non-dependent thread_info logging types
Browse files Browse the repository at this point in the history
...avoid instantiation of distinct std::map per logging message type
  • Loading branch information
K-ballo committed Nov 4, 2017
1 parent f0d25c0 commit df53900
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hpx/util/logging/detail/cache_before_init.hpp
Expand Up @@ -57,6 +57,13 @@ inline thread_id_type get_thread_id()
#endif
}

typedef bool (*is_enabled_func)();

struct thread_info {
thread_info() : last_enabled(nullptr) {}
is_enabled_func last_enabled;
};

#if defined( HPX_LOG_BEFORE_INIT_USE_CACHE_FILTER) \
|| defined( HPX_LOG_BEFORE_INIT_USE_LOG_ALL)
//////////////////////////////////////////////////////////////////
Expand All @@ -73,8 +80,6 @@ inline thread_id_type get_thread_id()
*/
template<class msg_type> struct cache_before_init {
private:
typedef bool (*is_enabled_func)();

struct message {
message(is_enabled_func is_enabled_, msg_type string_)
: is_enabled(is_enabled_), string(string_) {}
Expand All @@ -84,11 +89,6 @@ template<class msg_type> struct cache_before_init {
msg_type string;
};

struct thread_info {
thread_info() : last_enabled(nullptr) {}
is_enabled_func last_enabled;
};

struct cache {
cache() : is_using_cache(true) {}

Expand Down

0 comments on commit df53900

Please sign in to comment.