On Wed, Dec 20, 2017 at 2:45 AM, Xuanyi Chew wrote:
>
> I'm guessing also, that a "true" pointer has to be byte aligned - no pointer
> tagging shennanigans with unsafe.Pointer
You can do all the pointer tagging you like as long as the final bits
can not be interpreted as a pointer into the Go hea
On Wed, Dec 20, 2017 at 1:54 AM, Jan Mercl <0xj...@gmail.com> wrote:
>
> On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts
> wrote:
>
>> Pointers that point from a Go object to somewhere outside the Go heap are
>> perfectly fine.
>
> Can you please specify the exact mechanism used b
I'm guessing also, that a "true" pointer has to be byte aligned - no
pointer tagging shennanigans with unsafe.Pointer
On Wednesday, 20 December 2017 21:42:49 UTC+11, Xuanyi Chew wrote:
>
> I echo this.
>
> On Wednesday, 20 December 2017 20:55:03 UTC+11, Jan Mercl wrote:
>>
>>
>> On Wed, Dec 20, 2
I echo this.
On Wednesday, 20 December 2017 20:55:03 UTC+11, Jan Mercl wrote:
>
>
> On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts <
> golan...@googlegroups.com > wrote:
>
> > Pointers that point from a Go object to somewhere outside the Go heap
> are perfectly fine.
>
> Can you
On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> Pointers that point from a Go object to somewhere outside the Go heap are
perfectly fine.
Can you please specify the exact mechanism used by the runtime to determine
"is outside the Go heap"?
Pointers that point from a Go object to somewhere outside the Go heap are
perfectly fine.
The Go runtime will not try to dereference them.
unsafe.Pointer is ok, but so are concrete types, like *byte.
One caveat: the pointer must be a real pointer. Don't store a bunch of
bitfields in a Go pointer
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 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 t