Thanks. That is clear:

*A uintptr is an integer, not a reference. Converting a Pointer to a 
uintptr creates an integer value with no pointer semantics. Even if a 
uintptr holds the address of some object, the garbage collector will not 
update that uintptr's value if the object moves, nor will that uintptr keep 
the object from being reclaimed. *
This makes using the cgo wrapper I am working with more than a bit awkward, 
but I can work around it now that I know the rules.
 

On Sunday, November 26, 2017 at 2:45:46 PM UTC-5, Axel Wagner wrote:
>
> You can find the specific rules in the godoc of the unsafe package 
> <https://godoc.org/unsafe#Pointer>.
>
> On Sun, Nov 26, 2017 at 8:12 PM, Jan Mercl <0xj...@gmail.com <javascript:>
> > wrote:
>
>> On Sun, Nov 26, 2017 at 6:20 PM <jake...@gmail.com <javascript:>> wrote:
>>
>> > The core question is does a uintptr derived from a pointer to an object 
>> count as a reference as far as GC is concerned?
>>
>> Within a single expression yes, otherwise no.
>>
>> -- 
>>
>> -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...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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