On 09/28/2018 03:14 PM, Peter Mogensen wrote:
> In other words.. using a map as index into another datastructure without
> the map values being considered by the garbage collector as references.

I just quickly read about the java.util.WeakHashMap and it says that the
keys are the weak references - not the values.
So it's not exactly what I was thinking of. I wanted the values as weak
references.
But as Ian Lance Taylor pointed out, the unsafe packages doesn't allow
this, since:
"Conversion of a uintptr back to Pointer is not valid in general. "

... which would be needed to use the map as an index.

I guess that's basically the summary of this thread. Thanks for your input.

/Peter

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to