1. 02 Mar, 2011 3 commits
    • Roger Peppe's avatar
      fmt: allow recursive calls to Fscan etc. · 81bfbe93
      Roger Peppe authored
      Add a new Read method to ScanState so that it
      satisfies the io.Reader interface; rename
      Getrune and Ungetrune to ReadRune and UnreadRune.
      Make sure ReadRune does not read past width restrictions;
      remove now-unnecessary Width method from ScanState.
      Also make the documentation a little clearer as to
      how ReadRune and UnreadRune are used.
      
      R=r, r2
      CC=golang-dev
      https://golang.org/cl/4240056
      81bfbe93
    • Russ Cox's avatar
      runtime: record goroutine creation pc and display in traceback · 324cc3d0
      Russ Cox authored
      package main
      
      func main() {
              go func() { *(*int)(nil) = 0 }()
              select{}
      }
      
      panic: runtime error: invalid memory address or nil pointer dereference
      
      [signal 0xb code=0x1 addr=0x0 pc=0x1c96]
      
      runtime.panic+0xac /Users/rsc/g/go/src/pkg/runtime/proc.c:1083
              runtime.panic(0x11bf0, 0xf8400011f0)
      runtime.panicstring+0xa3 /Users/rsc/g/go/src/pkg/runtime/runtime.c:116
              runtime.panicstring(0x29a57, 0x0)
      runtime.sigpanic+0x144 /Users/rsc/g/go/src/pkg/runtime/darwin/thread.c:470
              runtime.sigpanic()
      main._func_001+0x16 /Users/rsc/g/go/src/pkg/runtime/x.go:188
              main._func_001()
      runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
              runtime.goexit()
      ----- goroutine created by -----
      main.main+0x3d /Users/rsc/g/go/src/pkg/runtime/x.go:4
      
      goroutine 1 [4]:
      runtime.gosched+0x77 /Users/rsc/g/go/src/pkg/runtime/proc.c:598
              runtime.gosched()
      runtime.block+0x27 /Users/rsc/g/go/src/pkg/runtime/chan.c:680
              runtime.block()
      main.main+0x44 /Users/rsc/g/go/src/pkg/runtime/x.go:5
              main.main()
      runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:77
              runtime.mainstart()
      runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:150
              runtime.goexit()
      ----- goroutine created by -----
      _rt0_amd64+0x8e /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:64
      
      Fixes #1563.
      
      R=r
      CC=golang-dev
      https://golang.org/cl/4243046
      324cc3d0
    • Brad Fitzpatrick's avatar
      http: initialize request Header for the transport · 9733f96b
      Brad Fitzpatrick authored
      Fixes #1558
      
      R=rsc, r, bradfitzwork
      CC=golang-dev
      https://golang.org/cl/4260042
      9733f96b
  2. 01 Mar, 2011 9 commits
  3. 28 Feb, 2011 7 commits
  4. 26 Feb, 2011 1 commit
    • Nigel Tao's avatar
      compress/lzw: don't use a closure in NewReader, which avoids having · fdbbb066
      Nigel Tao authored
      to move some variables from the stack to the heap.
      
      Sorted benchmark runs on my 2007-era Mac Mini (GOARCH=amd64, GOOS=linux):
      
      Before:
      lzw.BenchmarkDecoder        2000        878176 ns/op
      lzw.BenchmarkDecoder        2000        878415 ns/op
      lzw.BenchmarkDecoder        2000        880352 ns/op
      lzw.BenchmarkDecoder        2000        898445 ns/op
      lzw.BenchmarkDecoder        2000        901728 ns/op
      
      After:
      lzw.BenchmarkDecoder        2000        859065 ns/op
      lzw.BenchmarkDecoder        2000        859402 ns/op
      lzw.BenchmarkDecoder        2000        860035 ns/op
      lzw.BenchmarkDecoder        2000        860555 ns/op
      lzw.BenchmarkDecoder        2000        861109 ns/op
      
      The ratio of before/after median times is 1.024.
      
      The runtime.MemStats.Mallocs delta per loop drops from 109 to 104.
      
      R=r, r2, dfc
      CC=golang-dev
      https://golang.org/cl/4253043
      fdbbb066
  5. 25 Feb, 2011 17 commits
  6. 24 Feb, 2011 3 commits
    • Nigel Tao's avatar
      compress/lzw: implement an encoder. · 741eab4e
      Nigel Tao authored
      R=rsc, nigeltao_gnome
      CC=golang-dev
      https://golang.org/cl/4209043
      741eab4e
    • Russ Cox's avatar
      reflect: add pointer word to CommonType · 8d36a784
      Russ Cox authored
      The pointer will eventually let us find *T given T.
      This CL just makes room for it, always storing a zero.
      
      R=r, r2
      CC=golang-dev
      https://golang.org/cl/4221046
      8d36a784
    • Russ Cox's avatar
      runtime: fix signal stack bug · 820dc9ff
      Russ Cox authored
      In CL 4188061 I changed malg to allocate the requested
      number of bytes n, not n+StackGuard, so that the
      allocations would use rounder numbers.
      
      The allocation of the signal stack asks for 32k and
      then used g->stackguard as the base, but g->stackguard
      is StackGuard bytes above the base.  Previously, asking
      for 32k meant getting 32k+StackGuard bytes, so using
      g->stackguard as the base was safe.  Now, the actual base
      must be computed, so that the signal handler does not
      run StackGuard bytes past the top of the stack.
      
      Was causing flakiness mainly in programs that use the
      network, because they sometimes write to closed network
      connections, causing SIGPIPEs.  Was also causing problems
      in the doc/progs test.
      
      Also fix Makefile so that changes to stack.h trigger rebuild.
      
      R=bradfitzgo, r, r2
      CC=golang-dev
      https://golang.org/cl/4230044
      820dc9ff