[go-nuts] Re: A Question about `unsafe.Slice`

2022-02-05 Thread rmfr
I found the comments of `findObject` in the runtime source: ```go // findObject returns the base address for the heap object **containing** // the address p, the object's span, and the index of the object in s. // If p does not point into a heap object, it returns base == 0. // // If p points is a

[go-nuts] Re: A Question about `unsafe.Slice`

2022-02-05 Thread rmfr
It suddenly occurred to me that it was very like `re-slice` —— as long as part of the underlying array is referenced, the whole underlying array is never gc-ed. I guess there is a method in gc which could locate the whole underlying array as long as one address inside the array's address interva