Michael Ploujnikov <michael.ploujni...@oracle.com> writes:
> I thought it would be useful to others who are new to the GCC codebase
> to have an example of how to hash keys based on string contents rather
> than pointer addresses (the fact that some hash maps key based on
> semi-reliable pointers (due to ggc_mark_stringpool) into the symtab
> gives a false sense of security).
>
>
> - Michael
>
> From 3433efe4ac558de05410a9b185f4ff0a01e7e5df Mon Sep 17 00:00:00 2001
> From: Michael Ploujnikov <michael.ploujni...@oracle.com>
> Date: Fri, 11 Jan 2019 09:22:14 -0500
> Subject: [PATCH] Document how to hash based on key string contents.
>
> gcc:
>
> 2019-01-18  Michael Ploujnikov  <michael.ploujni...@oracle.com>
>
>       * hash-map-tests.c (test_map_of_strings_to_int): Document how
>       to hash based on key string contents.

OK, thanks.  Not sure whether this should really be treated as
documentation, but I can see how the current code could give a
misleading impression, and more testing is good either way.

Richard

Reply via email to