From 795d347d2a1e99b48c871e1031bfcd9b27a03d9f Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Wed, 14 Sep 2016 23:23:09 +0300 Subject: [PATCH] Linux build --- src/hashed_cstr.h | 12 ++++++++++++ src/profile_manager.cpp | 4 ++++ src/profile_manager.h | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/src/hashed_cstr.h b/src/hashed_cstr.h index b9896d9..ca775fb 100644 --- a/src/hashed_cstr.h +++ b/src/hashed_cstr.h @@ -203,6 +203,18 @@ namespace profiler { { } + hashed_stdstring(const char* _str, size_t _hash_code) : m_str(_str), m_hash(_hash_code) + { + } + + hashed_stdstring(const ::std::string& _str, size_t _hash_code) : m_str(_str), m_hash(_hash_code) + { + } + + hashed_stdstring(::std::string&& _str, size_t _hash_code) : m_str(::std::forward<::std::string&&>(_str)), m_hash(_hash_code) + { + } + hashed_stdstring(const hashed_stdstring&) = default; hashed_stdstring& operator = (const hashed_stdstring&) = default; diff --git a/src/profile_manager.cpp b/src/profile_manager.cpp index 1c65f2d..c91cc30 100644 --- a/src/profile_manager.cpp +++ b/src/profile_manager.cpp @@ -490,8 +490,12 @@ void ProfileManager::setBlockEnabled(profiler::block_id_t _id, const profiler::h } else { +#ifdef _WIN32 blocks_enable_status_t::key_type key(_key.c_str(), _key.size(), _key.hcode()); m_blocksEnableStatus[key] = _enabled; +#else + m_blocksEnableStatus[_key] = _enabled; +#endif } } diff --git a/src/profile_manager.h b/src/profile_manager.h index 0116763..4e013f7 100644 --- a/src/profile_manager.h +++ b/src/profile_manager.h @@ -312,7 +312,12 @@ class ProfileManager final typedef profiler::guard_lock guard_lock_t; typedef std::map map_of_threads_stacks; typedef std::vector block_descriptors_t; + +#ifdef _WIN32 typedef std::unordered_map blocks_enable_status_t; +#else + typedef std::unordered_map blocks_enable_status_t; +#endif map_of_threads_stacks m_threads; block_descriptors_t m_descriptors;