wrote:
> On Mon, Jul 8, 2024 at 12:38 PM Antonio Caceres Cabrera
> wrote:
> >
> > Sorry, accidentally hit the wrong response button, so I'm posting it
> again:
> >
> > Thanks for the clarification, Ian.
> >
> > Is it also possible to pin memory to local
yte)` ?
Julio
On Sunday, July 7, 2024 at 5:38:13 PM UTC+2 Ian Lance Taylor wrote:
> On Sun, Jul 7, 2024 at 6:17 AM Antonio Caceres Cabrera
> wrote:
> >
> > I'm trying to use cgo for a C library, specifically a function which
> takes a void pointer to a buffer, and I'm t
Hi Gophers,
I'm trying to use cgo for a C library, specifically a function which takes
a void pointer to a buffer, and I'm trying to pass a Go-Slice as this
buffer.
```
func Write(buf []byte) (int, error) {
// var pin rumtime.Pinner
// pin.Pin([0])
// defer pin.Unpin()
// is
Dear golang nuts,
I was trying to gain a better understanding of how cgo works internally,
when I stumbled upon this implementation detail:
https://github.com/golang/go/blob/8db131082d08e497fd8e9383d0ff7715e1bef478/src/runtime/cgocall.go#L628
```
case kindStruct:
st :=
On Sunday, August 27, 2023 at 7:05:15 PM UTC+2 Ian Lance Taylor wrote:
> On Sun, Aug 27, 2023 at 7:54 AM Antonio Caceres Cabrera
> wrote:
> >
> > Go vet complains about this minimal example code
> >
> > type Foo struct {
> > val atomic.Uint64
> > }
> >
&
Go vet complains about this minimal example code
type Foo struct {
val atomic.Uint64
}
func main() {
var foos = make([]Foo, 0)
var bar Foo
bar.val.Store(5)
foos = append(foos, bar) // call of append copies lock value:
example.com/foo.Foo contains
Hi Gophers,
I have a question about a more subtle part of the language, the memory
model regarding atomic operations.
The memory model doc on go.dev states:
>If the effect of an atomic operation *A* is observed by atomic operation
*B*, then *A* is synchronized before *B*.[...]
I.e. "observing