I've partially remembered why I used unsafe.Pointer instead of uintptr. In cases where the tensor was built from an existing memory (i.e building a tensor with Go allocated slice backing), I wanted the slice to not be GC'd away
On Wednesday, 20 December 2017 00:00:10 UTC+11, Jan Mercl wrote: > > On Tue, Dec 19, 2017 at 1:50 PM Xuanyi Chew <che...@gmail.com > <javascript:>> wrote: > > > As such I have no idea what would happen if the GC scanner hits a > unsafe.Pointer that it cannot access. Will the pointer be marked as > unaccessible? Does it panic with SIGBUS? > > I think the GC will not try to dereference a pointer that is known to > point outside of the Go runtime heap. If I'm wrong then it will panic. I > suggest to hide the potentially inaccessible unsafe.Pointer from being > considered by the GC at all by making it an uintptr instead. > > > -- > > -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.