libstdc++ PR 57272 Fancy pointer support in Hashtable

François Dumont frs.dumont@gmail.com
Thu Jun 10 17:22:01 GMT 2021


I would like to renew this proposal.

I considered all your feedbacks expect:

On 02/11/20 3:11 pm, Jonathan Wakely wrote:
>
> There's no point doing it if you still use raw pointers.
>
> It either has to be done completely, or it's a waste of time and
> energy.
>

Why ? Can you provide the Standard documentation explaining why the 
custom pointer must the used everywhere ?

For the moment I considered that fancy pointer types are meant to allow 
access to some special memory area in which a simple raw pointer is not 
enough to describe an instance location. This is why this patch is 
making sure that the fancy pointer is stored and returned to the 
allocator without any loss of information.

Otherwise, for internal Hashtable purpose simple raw pointers are still 
being used. I cannot imagine that any user is expecting to improve 
container performances with a hand written pointer implementation.

For the moment I ignore the comment in the PR about limiting operations 
done with the pointer (except that I am not using it everywhere of 
course). I will propose to add move semantic on those pointers if this 
patch is accepted.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtable_cust_ptr.patch
Type: text/x-patch
Size: 62503 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210610/2da0d371/attachment-0001.bin>


More information about the Libstdc++ mailing list