I ended up doing my own struct definition without the union (I only care
about the pointer variant) so I could go along with what Ian suggested
above:
> It would be OK to pass a pointer to a struct to ioctl if the
struct contains a pointer to other Go memory, but the struct field must
have poi
On Fri, May 17, 2019, 19:09 Matt Layher wrote:
> Thanks for the insight, this is very useful information. Perhaps I'll look
> into the mmap route.
>
Possibly useful: https://godoc.org/modernc.org/memory
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
Thanks for the insight, this is very useful information. Perhaps I'll look
into the mmap route.
- Matt
On Friday, May 17, 2019 at 12:54:28 PM UTC-4, Ian Lance Taylor wrote:
>
> On Fri, May 17, 2019 at 7:44 AM Matt Layher > wrote:
> >
> >> Pointers passed to unix.Syscall or syscall.Syscall are
On Fri, May 17, 2019 at 7:44 AM Matt Layher wrote:
>
>> Pointers passed to unix.Syscall or syscall.Syscall are always safe.
>> They will be treated as live for the duration of the call to Syscall,
>> and they will not be moved. This is a special exception for functions
>> written in assembly, doc
olang-nuts
Subject: Re: [go-nuts] Passing structures containing other
pointers to ioctl: Go vs Cgo memory
If Go ever adding a compacting collector I don't think these
techniques would work - I would start with cgo as you will be
protected then.
-Original Message---
-nuts
Subject: Re: [go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory
If Go ever adding a compacting collector I don't think these techniques would work - I would start with cgo as you will be protected then.-Original Message-
From: Matt Layher
Sent: May
If Go ever adding a compacting collector I don't think these techniques would work - I would start with cgo as you will be protected then.-Original Message-
From: Matt Layher
Sent: May 17, 2019 9:44 AM
To: golang-nuts
Subject: Re: [go-nuts] Passing structures containing other pointe
Hi Ian,
Pointers passed to unix.Syscall or syscall.Syscall are always safe.
> They will be treated as live for the duration of the call to Syscall,
> and they will not be moved. This is a special exception for functions
> written in assembly, documented at
> https://golang.org/pkg/unsafe/#Poi
On Thu, May 16, 2019 at 5:24 AM Matt Layher wrote:
>
> I'm working on a project that involves an ioctl API on OpenBSD. The idea is
> that you store a memory address in a union within another structure, and then
> invoke the ioctl. When it returns, both the structure itself and the memory
> poin
Hey folks,
I'm working on a project that involves an ioctl API on OpenBSD. The idea is
that you store a memory address in a union within another structure, and
then invoke the ioctl. When it returns, both the structure itself and the
memory pointed at by the address in the union are filled with
10 matches
Mail list logo