[go-nuts] Re: Go vet context leak error

2017-02-06 Thread Chad Retz
reachability algo or a reduced set of parameters where it's considered unreachable (i.e. when the var is used in other ways)? On Monday, February 6, 2017 at 3:35:05 PM UTC-6, Chad Retz wrote: > > I have the following function: > > func (s *SimplePeerConn) Read(b []byte) (n int, err

[go-nuts] Go vet context leak error

2017-02-06 Thread chad . retz
I have the following function: func (s *SimplePeerConn) Read(b []byte) (n int, err error) { ctx := context.Background() var maybeCancelFn context.CancelFunc func() { s.deadlineLock.RLock() defer s.deadlineLock.RUnlock() if !s.readDeadline.IsZero() { ctx, maybeCancelFn = con

Re: [go-nuts] Compiling a really really large package

2017-01-10 Thread chad . retz
Good deal. Issue opened at https://github.com/golang/go/issues/18602 and I attached code to replicate. On Tuesday, January 10, 2017 at 3:31:11 PM UTC-6, Ian Lance Taylor wrote: > > On Tue, Jan 10, 2017 at 9:47 AM, > > wrote: > > > > Is there any value in me reporting it? If helpful, I may be

Re: [go-nuts] Compiling a really really large package

2017-01-10 Thread chad . retz
Is there any value in me reporting it? If helpful, I may be able to toss a large tarball up on Dropbox or something. It's not really high priority for me either tbh because I know it would be difficult to stream the compilation inside the same package w/ circular refs and therefore may not be f

Re: [go-nuts] Compiling a really really large package

2017-01-10 Thread chad . retz
Just as an update, Go 1.8 doesn't help much, and the compile flags do reduce memory usage which only extends the inevitable time it runs out of memory. I guess I am at a loss here. I suppose this is not considered a bug, correct? Just a practical limitation of the compiler to use more memory pr

Re: [go-nuts] Compiling a really really large package

2017-01-09 Thread chad . retz
In my case, many of the functions are very small (many only a single line that I'm hoping will be inlined). This is a transpiler from another language (Java) akin to Grumpy (Python) and many of the functions are single-line dispatch methods to support OOP. The transpiler is at https://github.co

Re: [go-nuts] Compiling a really really large package

2017-01-09 Thread chad . retz
It does matter for my use case, but not for these first steps. Thanks. I think still, practically, I need to reduce the code size unfortunately. On Monday, January 9, 2017 at 12:24:36 PM UTC-6, Ian Lance Taylor wrote: > > On Mon, Jan 9, 2017 at 9:00 AM, > wrote: > > I have a really really large

[go-nuts] Compiling a really really large package

2017-01-09 Thread chad . retz
I have a really really large package of code that was generated via a code generator. Granted the main code that references it I expect to remove a lot via DCE or something so the binaries wouldn't be extreme. The code is > 140MB in the single package which I know sounds extreme. Let's ignore p

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-23 Thread chad . retz
Sorry, didn't read the whole thread, but here's how I tackled inheritance in my cross compiler: https://play.golang.org/p/UDp7nSLyl2. Granted, I am unsure about the unsafe thing, but the concept of a "method dispatcher" is likely what you need. On Wednesday, November 23, 2016 at 11:09:03 AM UTC