Re: [go-nuts] Panic with runtime cgo and go

2017-09-15 Thread webuser1200
Thanks and Sorry for not providing more details. I'm on 1.9. No unsafe package is used. Main program is a c program which calls into go functions where some analytics are performed. All calls to the golang use only strings and ints/floats/char. No structs are passed. In Go all strings are conv

[go-nuts] Re: Panic with runtime cgo and go

2017-09-15 Thread webuser1200
Some other errors that I've gotten from the the same program. > fatal error: unexpected signal during runtime execution > runtime: pointer 0xc43d78cba0 to unallocated span idx=0xebc6 > span.base()=0xbdf102 span.limit=0xbdf102 span.state=0 > runtime: found in object at *(0xc44474+0x

[go-nuts] Panic with runtime cgo and go

2017-09-15 Thread webuser1200
This program runs for about an hour and consumes about 1Gig of memory. I was getting a lot of these errors, but they were significantly reduced when I reduced the golang memory usage. (by reducing the in memory state that I was keeping) Any idea on how I can go about debugging this? -

[go-nuts] Need advice how to structure directory paths and build env for go modules being called from c.

2016-12-30 Thread webuser1200
/src//folder1 /src//folder2 /src//folder3 ... Everything works fine with go build ./src//... I've recently added a module (/src//folder4) which calls go code from c and and this go folder is built with: go build --buildmode=c-archive -o libgolang.a I'm not sure what the best practices are her

Re: [go-nuts] calling go functions from c

2016-10-02 Thread webuser1200
> > There is some overhead when using gccgo, because of the need to > interact with the Go scheduler. The overhead should be slightly less. > Any idea what (very rough is fine) that overhead is when compared to the standard go toolchain? -- You received this message because you are sub

Re: [go-nuts] calling go functions from c

2016-10-01 Thread webuser1200
Thanks for putting this together. I was trying to figure out how to do callback from c to go. There are fewer examples on the web for that since most of them deal with calling c code from go. C int -> go C.int C unsigned char -> C.uchar C char -> C.char C unsigned int -> C.uint C double -> C.do

Re: [go-nuts] calling go functions from c

2016-09-29 Thread webuser1200
Thanks for reading my question. I'm trying to map c to Go "C." C int -> go C.int C unsigned char -> ? C char -> ? C unsigned short -> ? C double -> ? C __int64 -> ? C *char -> C.string On Friday, September 30, 2016 at 1:27:13 AM UTC-4, Ian Lance Taylor wrote: > > On Thu, Sep 29, 2016 at 8:59 PM

[go-nuts] calling go functions from c

2016-09-29 Thread webuser1200
I have a basic example working of calling back into go from C. If I have a C function as: func Add(a, b C.Int) C.Int { return a + b } Where is the mapping of C type to C. when I want to pass additional types to Go : 1. Unsigned int 2. char 3. double 4. string 5. short etc... -- You received

[go-nuts] Multi Variable Linear Regression (with r squared and p values)

2016-07-23 Thread webuser1200
I'm trying to port over some code using linear regression (statsmodule package) in python to golang. I need the library to give me r square and p values for each coefficient/variable. Is there such a library in golang or c (that I can write bindings for)? WU -- You received this message bec