On Fri, Mar 1, 2019 at 6:37 AM Cholerae Hu <cholerae...@gmail.com> wrote:

> Will 'a' be scanned by go runtime?

Yes.

> It is allocate by go runtime.

Correct and that's the reason the GC will handle it normally.

> If p is scanned, go runtime should throw a 'bad pointer' error, because
the memory pointed by p is allocated by C.malloc, not go runtime.

The GC knows that p points to memory not obtained from Go runtime and will
not consider it in its analysis.

-- 

-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