The documentation specifies that a pointer can be cast into a uintptr 
integer. I assume that the uintptr is ignored by the garbage collector. 

I would like to compute a hash over the uintptr. How do I achieve that ? 

The documentation doesn’t specify that we can cast an uintptr into a 
uint64. The byte size may not match. What would be the idiomatic way to 
compute a hash over a uintpr ? Is it valid to do that ? 

To give some context, the application is for a cache with the hash key 
computed over a pointer to a heap allocated struct. I need to store the 
pointer in the cache entry to test for matching, but this would prevent the 
struct to be garbage collected. Storing the pointer as an uintptr would do 
the trick. 

-- 
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/7983a13f-5bf6-4299-a598-1d023ec9a9e9n%40googlegroups.com.

Reply via email to