Re: [PATCH 4/4] gdb: change regcache list to be a map

Simon Marchi
2020-07-30T17:07:59Z

On 2020-07-30 12:58 p.m., Simon Marchi wrote:
> Huh, I did that because there's no std::hash overload for uintptr_t. But
> I just saw there is:
>
> template< class T > struct hash<T*>;
>
> which seems to be for hashing pointers. It is implemented as:
>
> return reinterpret_cast<size_t>(__p);
>
> So I'll just use that. Otherwise, htab_hash_pointer would be good too.

And I just realized that it makes sense for this to exist, since you can use
pointers as keys in a map without doing anything special.

Simon