mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
Specialize std::hash for ptid_t
This changes hash_ptid to instead be a specialization of std::hash. This makes it a little easier to use with standard containers. Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
@ -462,7 +462,7 @@ public:
|
|||||||
|
|
||||||
/* A map of ptid_t to thread_info*, for average O(1) ptid_t lookup.
|
/* A map of ptid_t to thread_info*, for average O(1) ptid_t lookup.
|
||||||
Exited threads do not appear in the map. */
|
Exited threads do not appear in the map. */
|
||||||
std::unordered_map<ptid_t, thread_info *, hash_ptid> ptid_thread_map;
|
std::unordered_map<ptid_t, thread_info *> ptid_thread_map;
|
||||||
|
|
||||||
/* Returns a range adapter covering the inferior's threads,
|
/* Returns a range adapter covering the inferior's threads,
|
||||||
including exited threads. Used like this:
|
including exited threads. Used like this:
|
||||||
|
@ -329,7 +329,7 @@ reg_buffer::assert_regnum (int regnum) const
|
|||||||
regcaches, associated to different gdbarches). */
|
regcaches, associated to different gdbarches). */
|
||||||
|
|
||||||
using ptid_regcache_map
|
using ptid_regcache_map
|
||||||
= std::unordered_multimap<ptid_t, regcache_up, hash_ptid>;
|
= std::unordered_multimap<ptid_t, regcache_up>;
|
||||||
|
|
||||||
/* Type holding regcaches for a given pid. */
|
/* Type holding regcaches for a given pid. */
|
||||||
|
|
||||||
|
@ -157,9 +157,8 @@ private:
|
|||||||
tid_type m_tid;
|
tid_type m_tid;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Functor to hash a ptid. */
|
template<>
|
||||||
|
struct std::hash<ptid_t>
|
||||||
struct hash_ptid
|
|
||||||
{
|
{
|
||||||
size_t operator() (const ptid_t &ptid) const
|
size_t operator() (const ptid_t &ptid) const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user