On Tue, Feb 13, 2018 at 4:28 PM Ian Lance Taylor <i...@golang.org> wrote:

> I think that will work today but we make no promise that it will
> continue to work in the future. In particular it will fail if the
> garbage collector ever starts to move objects.

Right, I forgot about that and thanks for the heads up, Ian.

Actually, IINM, non-escaping Go objects are already possibly allocated and
thus also moved within Go stacks. So my claim about being safe with Go
pointers living in mmap'ed memory under certain conditions would have to be
tightened even more - no pointers into Go stack. But there's, in the first
approximation, no way how to know if a Go object is heap or stack
allocated, so the outcome actually is - it's generally not safe to have
_any_ Go pointers outside Go managed memory.

Sorry for the noise.

-- 

-j

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