0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 08:41:02 +08:00

Linux build

This commit is contained in:
Victor Zarubkin 2016-09-14 23:23:09 +03:00
parent 330951cb62
commit 795d347d2a
3 changed files with 21 additions and 0 deletions

View File

@ -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;

View File

@ -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
}
}

View File

@ -312,7 +312,12 @@ class ProfileManager final
typedef profiler::guard_lock<profiler::spin_lock> guard_lock_t;
typedef std::map<profiler::thread_id_t, ThreadStorage> map_of_threads_stacks;
typedef std::vector<profiler::BlockDescriptor*> block_descriptors_t;
#ifdef _WIN32
typedef std::unordered_map<profiler::hashed_cstr, bool> blocks_enable_status_t;
#else
typedef std::unordered_map<profiler::hashed_stdstring, bool> blocks_enable_status_t;
#endif
map_of_threads_stacks m_threads;
block_descriptors_t m_descriptors;