Matthew Dempsky

Results 120 comments of Matthew Dempsky

@Vadskye FYI, your test case seems to work with my gocode fork (mdempsky/gocode). You can try it out with `gocode close; go get github.com/mdempsky/gocode`. (And if you need/want to switch...

So the natural time to do the rewrite would be during IR construction, which currently happens before initialization ordering. That rewrite would unfortunately affect when `m` is initialized. But along...

https://go-review.googlesource.com/c/go/+/423074 tested a non-generic version of the test, and it still flaked on arm with "never GC'd": https://storage.googleapis.com/go-build-log/019cddda/linux-arm-aws_8b1e8c2b.log

> I don't think we need an exported cgo.Incomplete - we can do whatever we need to let cgo see things others can't. > (Maybe an internal/cgo?) This is ok...

FWIW, the reason I suggested `runtime/cgo.Incomplete` initially is so we'd have a name specifically for the semantics of incomplete C types. Immediately, this would be in terms of NotInHeap, because...

> @mdempsky do you want to try a prototype and see whether it works in practice? Done. For the cgo CL, I used runtime/cgo.Incomplete as initially proposed above. This is...

> Or are all of these already misusing the directive? The only supported directives are documented at https://pkg.go.dev/cmd/compile#hdr-Compiler_Directives. The `//go:notinheap` directive has only ever been documented within the runtime's internal...

> A late testimony that this will make my life harder: inet.af/wf interacts with the windows filtering platform through cgo, which unusually requires that structs passed to it be allocated...

Proof-of-concept implementation of an ssa-based checker: https://github.com/mdempsky/notinheap I'll leave it to others to polish into a fully usable package and checker. > TIL x/tools/go/ssa, thanks. Its documentation warns that anything...