Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-28 Thread Ian Lance Taylor
On Sun, Feb 28, 2021 at 1:06 AM Reto wrote: > > On Sat, Feb 27, 2021 at 06:56:04PM -0800, Ian Lance Taylor wrote: > > Although rule 4 in the documentation of the unsafe package mentions > > syscall.Syscall, the implementation isn't restricted to the syscall > > package. It applies to any function

Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-28 Thread Reto
Thanks to both of you. On Sat, Feb 27, 2021 at 06:56:04PM -0800, Ian Lance Taylor wrote: > Although rule 4 in the documentation of the unsafe package mentions > syscall.Syscall, the implementation isn't restricted to the syscall > package. It applies to any function that is written in assembly: t

Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-27 Thread Ian Lance Taylor
On Sat, Feb 27, 2021 at 5:12 PM 'Axel Wagner' via golang-nuts wrote: > > On Sat, Feb 27, 2021 at 11:19 PM Reto wrote: >> >> Now, as far as I can tell this forces non stdlib packages to adhere to >> exactly that. >> As far as I can tell x/sys is just a common namespace for the go authors, but >>

Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-27 Thread 'Axel Wagner' via golang-nuts
Oh, forgot to mention: The code I linked to has been moved or removed in master, vs. go 1.16. So the time of "when the implementation changes" might be "now" :) On Sun, Feb 28, 2021 at 2:11 AM Axel Wagner wrote: > Hi, > > not an expert, but. > > On Sat, Feb 27, 2021 at 11:19 PM Reto wrote: > >>

Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-27 Thread 'Axel Wagner' via golang-nuts
Hi, not an expert, but. On Sat, Feb 27, 2021 at 11:19 PM Reto wrote: > Now, as far as I can tell this forces non stdlib packages to adhere to > exactly that. > As far as I can tell x/sys is just a common namespace for the go authors, > but > as far as the compiler itself is concerned, that's a

[go-nuts] golang.org/x/sys and unsafe usage

2021-02-27 Thread Reto
Hi, I'm a bit confused as to how the golang.org/x/sys package works. >From the documentation of unsafe.Pointer: >(4) Conversion of a Pointer to a uintptr when calling syscall.Syscall. > The Syscall functions in package syscall pass their uintptr arguments > directly to the operating system, which