Unless you are holding a real pointer to the value, they will have no
root to hold them and so will by GC'd. Further, the uintptr in the map
will not be updated if the value is moved (does not happen now but may
in the future).

What you're doing here is unsafe.

On Thu, 2018-09-27 at 19:52 +0200, Peter Mogensen wrote:
> My intention was then to handle that responsibility by temporarily
> storing these pointers as uintptr and by using them as a value in a
> map,
> be able to exploit the map-of-non-pointers optimization to avoid GC
> scans of the map.

-- 
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