Re: [go-nuts] How to compile a go program which uses cgo to llvm IR?

2021-06-10 Thread 'Than McIntosh' via golang-nuts
Hello, As described in https://go.googlesource.com/gollvm/#seetheir, you will generally want to run "go build" in order to see the correct invocation of llvm-goc for your use case. In your case (building a Go file that uses CGO), there is a lot happening "under the hood" when you do the build --

[go-nuts] Type assertion: panic: value method time.Time.String called using nil *Time pointer"

2021-06-10 Thread Markus Heukelom
Code: package main import ( "fmt" "time" ) func main() { var my *time.Time var any interface{} any = my stringer, ok := any.(fmt.Stringer) println(ok) // "true", but I expected "false", as the receiver for time.Time.String() is (t time.Time), not (t *time.Time) println(stringer.String()) // "p

Re: [go-nuts] Type assertion: panic: value method time.Time.String called using nil *Time pointer"

2021-06-10 Thread 'Axel Wagner' via golang-nuts
On Thu, Jun 10, 2021 at 2:50 PM Markus Heukelom wrote: > Question 1: > > I don't understand when the type assertion succeeds here, as the receiver > for time.Time.String() is (t time.Time), not (t *time.Time). > The method set of `*Time` includes all methods declared on `Time` (but not vice-vers

[go-nuts] Go 1.17 Beta 1 is released

2021-06-10 Thread Dmitri Shuralyov
Hello gophers, We have just released go1.17beta1, a beta version of Go 1.17. It is cut from the master branch at the revision tagged go1.17beta1. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Report any prob

[go-nuts] It's possible to replace cgo memory allocator?

2021-06-10 Thread Diego Bernardes
I'm using cgo and struggling to find a memory leak which can be easily detected if I can replace the cgo memory allocator to the one the C library I'm using have because they did a leak detector implementation there. It's possible? -- You received this message because you are subscribed to th

[go-nuts] Re: It's possible to replace cgo memory allocator?

2021-06-10 Thread Howard C. Shaw III
The DGraph.io team has a blog post about swapping to using jemalloc for CGo (they are going further and feeding their allocations into Go to avoid garbage collection, but that is a separate issue). https://dgraph.io/blog/post/manual-memory-management-golang-jemalloc/ On Thursday, June 10, 2021

Re: [go-nuts] How to compile a go program which uses cgo to llvm IR?

2021-06-10 Thread Ian Lance Taylor
On Wed, Jun 9, 2021 at 11:27 PM Peng Deng wrote: > > Hi, I have the following program > > package main > > /* > #include > > static void SayHello(const char* s) { > puts(s); > } > */ > import "C" > > func main() { > C.SayHello(C.CString("Hello, World\n")) > } > > I want to compile this pr

Re: [go-nuts] Trying to port Go to HPE NonStop x86 - Need some guidance

2021-06-10 Thread Ian Lance Taylor
On Wed, Jun 9, 2021 at 6:16 AM Shiva wrote: > > I have now duped all of the linux files and created nsx variants, I've also > set the environment variables GOOS to nsx and GOARCH to amd64. When I tried > to run make.bat (If you try to port and run bootstrap.sh on windows, you get > an error mes