Re: [PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-17 Thread Jonathan Wakely
On Mon, 17 Jun 2024 at 11:18, Jonathan Wakely wrote: > > On Sat, 15 Jun 2024 at 14:04, François Dumont wrote: > > > > Here is the simplified patch then. > > The use of std::__to_address seems wrong. > > The allocator returns a __buckets_ptr, and that function returns a > __buckets_ptr, so it shou

Re: [PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-17 Thread Jonathan Wakely
On Sat, 15 Jun 2024 at 14:04, François Dumont wrote: > > Here is the simplified patch then. The use of std::__to_address seems wrong. The allocator returns a __buckets_ptr, and that function returns a __buckets_ptr, so it should just be returned unchanged, not by converting to a raw pointer with

Re: [PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-15 Thread François Dumont
Here is the simplified patch then.     libstdc++: Do not use memset in _Hashtable buckets allocation     Using memset is incorrect if the __bucket_ptr type is non-trivial, or     does not use an all-zero bit pattern for its null value.     Replace the use of memset with std::__uinitialized_defa

Re: [PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-13 Thread Jonathan Wakely
On Thu, 13 Jun 2024 at 19:57, Jonathan Wakely wrote: > > On Thu, 13 Jun 2024 at 18:40, François Dumont wrote: > > > > Hi > > > > Following your recent change here: > > > > https://gcc.gnu.org/pipermail/libstdc++/2024-June/058998.html > > > > I think we also need to fix the memset at bucket alloca

Re: [PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-13 Thread Jonathan Wakely
On Thu, 13 Jun 2024 at 18:40, François Dumont wrote: > > Hi > > Following your recent change here: > > https://gcc.gnu.org/pipermail/libstdc++/2024-June/058998.html > > I think we also need to fix the memset at bucket allocation level. > > I did it trying also to be more fancy pointer friendly by

[PATCH] libstdc++: Do not use memset _Hashtable buckets allocation

2024-06-13 Thread François Dumont
Hi Following your recent change here: https://gcc.gnu.org/pipermail/libstdc++/2024-June/058998.html I think we also need to fix the memset at bucket allocation level. I did it trying also to be more fancy pointer friendly by running __uninitialized_default_n_a on the allocator returned pointe