Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-14 Thread Jonathan Wakely
On Fri, 14 Mar 2025 at 08:55, Florian Weimer wrote: > > * Jonathan Wakely: > > >> I still think this is more confusing than necessary. If there isn't > >> some general rule that empty objects can be considered stateless, that > >> should be added somewhere, too. 8-) > > > > Could you submit an is

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-14 Thread Florian Weimer
* Jonathan Wakely: >> I still think this is more confusing than necessary. If there isn't >> some general rule that empty objects can be considered stateless, that >> should be added somewhere, too. 8-) > > Could you submit an issue (or two)? > https://cplusplus.github.io/LWG/lwg-active.html#subm

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Florian Weimer
* Jonathan Wakely: > On Thu, 13 Mar 2025 at 09:24, Florian Weimer wrote: >> >> * Jonathan Wakely: >> >> > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: >> >> >> >> * François Dumont: >> >> >> >> > + // Get hash code for a node that comes from another _Hashtable. >> >> > + // Reus

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 11:51, Florian Weimer wrote: > > * Jonathan Wakely: > > > On Thu, 13 Mar 2025 at 09:24, Florian Weimer wrote: > >> > >> * Jonathan Wakely: > >> > >> > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: > >> >> > >> >> * François Dumont: > >> >> > >> >> > + // Get has

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 09:58, Jonathan Wakely wrote: > > On Thu, 13 Mar 2025 at 09:54, Jonathan Wakely wrote: > > > > On Thu, 13 Mar 2025 at 09:24, Florian Weimer wrote: > > > > > > * Jonathan Wakely: > > > > > > > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: > > > >> > > > >> * François

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 09:54, Jonathan Wakely wrote: > > On Thu, 13 Mar 2025 at 09:24, Florian Weimer wrote: > > > > * Jonathan Wakely: > > > > > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: > > >> > > >> * François Dumont: > > >> > > >> > + // Get hash code for a node that comes fro

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 09:24, Florian Weimer wrote: > > * Jonathan Wakely: > > > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: > >> > >> * François Dumont: > >> > >> > + // Get hash code for a node that comes from another _Hashtable. > >> > + // Reuse a cached hash code if the has

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Florian Weimer
* Jonathan Wakely: > On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: >> >> * François Dumont: >> >> > + // Get hash code for a node that comes from another _Hashtable. >> > + // Reuse a cached hash code if the hash function is stateless, >> > + // otherwise recalculate it using

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 06:50, Florian Weimer wrote: > > * François Dumont: > > > + // Get hash code for a node that comes from another _Hashtable. > > + // Reuse a cached hash code if the hash function is stateless, > > + // otherwise recalculate it using our own hash function. > >

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-03-12 Thread Florian Weimer
* François Dumont: > + // Get hash code for a node that comes from another _Hashtable. > + // Reuse a cached hash code if the hash function is stateless, > + // otherwise recalculate it using our own hash function. > + __hash_code > + _M_hash_code_ext(const __node_value_ty

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-02-24 Thread Jonathan Wakely
On Mon, 24 Feb 2025 at 20:52, François Dumont wrote: > > All good remarks as usual, here is a new version. > > I took the time to leverage on the new method to replace a usage of > _M_src_hash_code. > > libstdc++: [_Hashtable] Fix hash code cache usage when stateful > hash functor > > It

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-02-24 Thread François Dumont
All good remarks as usual, here is a new version. I took the time to leverage on the new method to replace a usage of _M_src_hash_code.     libstdc++: [_Hashtable] Fix hash code cache usage when stateful hash functor     It is wrong to reuse a cached hash code from another container when t

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-02-19 Thread Jonathan Wakely
On Mon, 17 Feb 2025 at 21:27, François Dumont wrote: > > Ping for this bug fix, would you like a PR ? No, I don't think we need one, I'm reviewing the patch now. > > On 20/01/2025 22:12, François Dumont wrote: > > Hi > > > > In my work on fancy pointer support I've decided to always cache the >

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-02-19 Thread Jonathan Wakely
On 20/01/25 22:12 +0100, François Dumont wrote: Hi In my work on fancy pointer support I've decided to always cache the hash code. Doing so I spotted a bug in the management of this cache when hash functor is stateful.     libstdc++: [_Hashtable] Fix hash code cache usage when hash functo

Re: [PATCH][_Hashtable] Fix hash code cache usage

2025-02-17 Thread François Dumont
Ping for this bug fix, would you like a PR ? On 20/01/2025 22:12, François Dumont wrote: Hi In my work on fancy pointer support I've decided to always cache the hash code. Doing so I spotted a bug in the management of this cache when hash functor is stateful.     libstdc++: [_Hashtable] F