On Thu, Dec 24, 2020 at 11:19 AM Arnaud Delobelle <arno...@gmail.com> wrote:

> Does that sound like a sensible approach?  I.e. is it safe enough to use
> the go:linkname directive, and do those seem like the right functions to
> call to obtain a good hash?
>

It is probably better to use hash/maphash, if you can.
https://golang.org/pkg/hash/maphash/
It's the intended use-case for that package and not subject to changes in
the runtime. However, the downside is that it doesn't allow all the same
values to be used as keys as Go maps do (you have to do the mapping from
values to []byte manually), so it might not be suitable.

Personally, I feel that go:linkname and similar trickery is too much black
magic to actually use. But TBF, I might be too biased on cleanliness over
performance and other concerns.


> TIA
>
> --
> Arnaud
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/79e3f124-037c-4c10-a7b6-42f496bd26b6n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/79e3f124-037c-4c10-a7b6-42f496bd26b6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfHi6R8wkx%2B%3DkOkmkqOCHcY8UuNfjHCYhfDchZNzBRG2%3Dw%40mail.gmail.com.

Reply via email to