1. 01 Mar, 2013 5 commits
  2. 28 Feb, 2013 31 commits
    • Rob Pike's avatar
      doc/articles/image_package.html: fix x/y mistake · 2145cd51
      Rob Pike authored
      Fixes #4942.
      
      R=golang-dev, adg
      CC=golang-dev
      https://golang.org/cl/7444047
      2145cd51
    • Robert Griesemer's avatar
      go/types: fix type-checking of shift expressions · 3a9fcc45
      Robert Griesemer authored
      Completely rethought shift expression type checking.
      Instead of attempting to type-check them eagerly, now
      delay the checking of untyped constant lhs in non-
      constant shifts until the final expression type
      becomes clear. Once it is clear, update the respective
      expression tree with the final (not untyped) type and
      check respective shift lhs' where necessary.
      
      This also cleans up another conundrum: How to report
      the type of untyped constants as it changes from
      untyped to typed. Now, Context.Expr is only called
      for an expresion x once x has received its final
      (not untyped) type (for constant initializers, the
      final type may still be untyped).
      
      With this CL all remaining std lib packages that
      did not typecheck due to shift errors pass now.
      
      TODO: There's a lot of residual stuff that needs
      to be cleaned up but with this CL all tests pass
      now.
      
      R=adonovan, axwalk
      CC=golang-dev
      https://golang.org/cl/7381052
      3a9fcc45
    • Dmitriy Vyukov's avatar
      runtime: refactor Syscall benchmark · 38d4d3c6
      Dmitriy Vyukov authored
      And add a benchmark where #goroutines>GOMAXPROCS,
      because it's the most interesting case.
      Current results on darwin/amd64, Intel Core 2 Duo 2.13 GHz, 2 cores:
      BenchmarkSyscall	100000000	        56.0 ns/op
      BenchmarkSyscall-2	50000000	        57.2 ns/op
      BenchmarkSyscallWork	10000000	       635 ns/op
      BenchmarkSyscallWork-2	10000000	       315 ns/op
      BenchmarkSyscallExcess	 1000000	      2698 ns/op
      BenchmarkSyscallExcess-2	 5000000	      1192 ns/op
      BenchmarkSyscallExcessWork	 1000000	      2832 ns/op
      BenchmarkSyscallExcessWork-2	 2000000	      1966 ns/op
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/7415044
      38d4d3c6
    • Dmitriy Vyukov's avatar
      runtime: add matrix multiplication benchmark · 72b09bd7
      Dmitriy Vyukov authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/7431047
      72b09bd7
    • Akshat Kumar's avatar
      os: Plan 9: allocate space for a string in Rename · bd889907
      Akshat Kumar authored
      The Name field of the stat structure is variable length
      and the marshalling code in package syscall requires
      a buf long enough to contain the Name as well as the
      static data. This change makes sure that the buffer in
      os.Rename is allocated with the appropriate length.
      
      R=rsc, rminnich, ality, r
      CC=golang-dev
      https://golang.org/cl/7453044
      bd889907
    • Russ Cox's avatar
      runtime/cgo: move common symbol overrides into 6c-compiled code · 5bffa3b8
      Russ Cox authored
      There are some function pointers declared by 6c in
      package runtime without initialization and then also
      declared in package runtime/cgo with initialization,
      so that if runtime/cgo is linked in, the function pointers
      are non-nil, and otherwise they are nil. We depend on
      this property for implementing non-essential cgo hooks
      in package runtime.
      
      The declarations in package runtime are 6c-compiled
      and end up in .6 files. The declarations in package runtime/cgo
      are gcc-compiled and end up in .o files. Since 6l links the .6
      and .o files together, this all works.
      
      However, when we switch to "external linking" mode,
      6l will not see the .o files, and it would be up to the host linker
      to resolve the two into a single initialized symbol.
      Not all host linkers will do this (in particular OS X gcc will not).
      
      To fix this, move the cgo declarations into 6c-compiled code,
      so that they end up in .6 files, so that 6l gets them no matter what.
      
      R=golang-dev
      CC=golang-dev
      https://golang.org/cl/7440045
      5bffa3b8
    • Rob Pike's avatar
      doc: correct some minor HTML errors found by tidy · 7ae41e80
      Rob Pike authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7439046
      7ae41e80
    • Russ Cox's avatar
      encoding/gob: fix copyright · 349cc748
      Russ Cox authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7423046
      349cc748
    • Russ Cox's avatar
      runtime/cgo: make symbol naming consistent · f8d49b50
      Russ Cox authored
      The naming in this package is a disaster.
      Make it all consistent.
      
      Remove some 'static' from functions that will
      be referred to from other files soon.
      
      This CL is purely renames using global search and replace.
      
      Submitting separately so that real changes will not
      be drowned out by these renames in future CLs.
      
      TBR=iant
      CC=golang-dev
      https://golang.org/cl/7416046
      f8d49b50
    • Russ Cox's avatar
      cmd/ld: fix symbol table sorting · 40ed753e
      Russ Cox authored
      runtime: double-check that symbol table is sorted
      
      If the symbol table is unsorted, the binary search in findfunc
      will not find its func, which will make stack traces stop early.
      When the garbage collector starts using the stack tracer,
      that would be a serious problem.
      
      The unsorted symbol addresses came from from two things:
      
      1. The symbols in an ELF object are not necessarily sorted,
         so sort them before adding them to the symbol list.
      
      2. The __i686.get_pc_thunk.bx symbol is present in multiple
         object files and was having its address adjusted multiple
         times, producing an incorrect address in the symbol table.
      
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/7440044
      40ed753e
    • Rob Pike's avatar
      all: fix a few more printf arg bugs found by go vet · 1bf66f08
      Rob Pike authored
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/7413045
      1bf66f08
    • Rob Pike's avatar
      cmd/vet: %b is a valid floating-point format. · 3dc7f17e
      Rob Pike authored
      Also add a report about "invalid type" from gotype, if -v is set.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7420045
      3dc7f17e
    • Robin Eklind's avatar
      cgo: fix reference to puts in implementation comment. · f82ea304
      Robin Eklind authored
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/7431046
      f82ea304
    • Russ Cox's avatar
      cmd/cgo: extend implementation comment · b89000bc
      Russ Cox authored
      This is the plan for how to make host linking work with
      the rest of the system.
      
      There are two complications:
      
      1. It is a goal to preserve the property that pure Go programs
      (even ones importing "net") can be compiled without needing
      gcc, so that a Go toolchain download works out of the box.
      This forces the support for two linking modes: with and without
      gcc.
      
      2. It is a goal to allow users with old copies of SWIG to continue
      to use those copies. This forces the support for "internal only"
      packages. Perhaps it is reasonable to require a new SWIG.
      I don't know.
      
      R=iant
      CC=golang-dev
      https://golang.org/cl/7433043
      b89000bc
    • Matt Brown's avatar
      strconv: use Quote to escape the input string for failed conversion errors · 1300fb54
      Matt Brown authored
      This reveals the presence of control and non-printable characters in the
      errors returned by the Parse functions.  Also add unit tests for NumError.
      
      R=golang-dev, r, rsc
      CC=golang-dev
      https://golang.org/cl/7393075
      1300fb54
    • Rob Pike's avatar
      C: add googler Matt Brown mdbrown@google.com · ee95c95e
      Rob Pike authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/7444045
      ee95c95e
    • John Graham-Cumming's avatar
      net/http: fix handling of HEAD in ReadResponse and (*http.Response).Write · 087b708f
      John Graham-Cumming authored
      The test suite for ReadResponse was not checking the error return on the io.Copy
      on the body. This was masking two errors: the handling of chunked responses to
      HEAD requests and the handling of Content-Length > 0 to HEAD.
      
      The former manifested itself as an 'unexpected EOF' when doing the io.Copy
      because a chunked reader was assigned but there were no chunks to read. The
      latter cause (*http.Response).Write to report an error on HEAD requests
      because it saw a Content-Length > 0 and expected a body.
      
      There was also a missing \r\n in one chunked test that meant that the chunked
      encoding was malformed. This does not appear to have been intentional.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7407046
      087b708f
    • Shenghou Ma's avatar
      cmd/go: fix "go run" cgo source when cgo is disabled · 6ecb39fc
      Shenghou Ma authored
      also move a cgo-depend test to appropriate source file in runtime.
      
      R=golang-dev, dave, adg, rsc
      CC=golang-dev
      https://golang.org/cl/7393063
      6ecb39fc
    • Rémy Oudompheng's avatar
      log/syslog: fix race in test between channel close and accept. · 67d0445c
      Rémy Oudompheng authored
      Fixes #4769.
      
      R=golang-dev, dave, adg, bradfitz
      CC=fullung, golang-dev
      https://golang.org/cl/7322089
      67d0445c
    • Rémy Oudompheng's avatar
      runtime: fix racefuncenter argument corruption. · e2f9e816
      Rémy Oudompheng authored
      Revision 6a88e1893941 corrupts the argument to
      racefuncenter by pushing the data block pointer
      to the stack.
      
      Fixes #4885.
      
      R=dvyukov, rsc
      CC=golang-dev
      https://golang.org/cl/7381053
      e2f9e816
    • Akshat Kumar's avatar
      net: pass tests on Plan 9 · b2249f20
      Akshat Kumar authored
      Ignore problematic tests and un-ignore one
      we can now pass.
      
      R=rsc, rminnich, ality, dave, bradfitz
      CC=golang-dev
      https://golang.org/cl/7396060
      b2249f20
    • Mikio Hara's avatar
      net: fix slow network interface manipulations · 322214cf
      Mikio Hara authored
      This CL reduces unnecessary network facility lookups introduced
      by recent changes below.
      
      changeset: 15798:53a4da6a4f4a
      net: return correct point-to-point interface address on linux
      
      changeset: 15799:a81ef8e0cc05
      net: set up IPv6 scoped addressing zone for network facilities
      
      Also adds a test case for issue	4839.
      
      Benchmark results on linux/amd64, virtual machine:
      benchmark                                 old ns/op    new ns/op    delta
      BenchmarkInterfaces-2                         80487        80382   -0.13%
      BenchmarkInterfaceByIndex-2                   72013        71391   -0.86%
      BenchmarkInterfaceByName-2                    79865        80101   +0.30%
      BenchmarkInterfaceAddrs-2                     42071       829677  +1872.09%
      BenchmarkInterfacesAndAddrs-2                 35016       607622  +1635.27%
      BenchmarkInterfacesAndMulticastAddrs-2       169849       169082   -0.45%
      old: 15797:9c3930413c1b, new: tip
      
      Benchmark results on linux/amd64, virtual machine:
      benchmark                                 old ns/op    new ns/op    delta
      BenchmarkInterfaces-2                         80487        81459   +1.21%
      BenchmarkInterfaceByIndex-2                   72013        71512   -0.70%
      BenchmarkInterfaceByName-2                    79865        80567   +0.88%
      BenchmarkInterfaceAddrs-2                     42071       120108  +185.49%
      BenchmarkInterfacesAndAddrs-2                 35016        33259   -5.02%
      BenchmarkInterfacesAndMulticastAddrs-2       169849        82391  -51.49%
      old: 15797:9c3930413c1b, new: tip+CL7400055
      
      Benchmark results on darwin/amd64:
      benchmark                                 old ns/op    new ns/op    delta
      BenchmarkInterfaces-2                         34402        34231   -0.50%
      BenchmarkInterfaceByIndex-2                   13192        12956   -1.79%
      BenchmarkInterfaceByName-2                    34791        34388   -1.16%
      BenchmarkInterfaceAddrs-2                     36565        63906  +74.77%
      BenchmarkInterfacesAndAddrs-2                 17497        31068  +77.56%
      BenchmarkInterfacesAndMulticastAddrs-2        25276        66711  +163.93%
      old: 15797:9c3930413c1b, new: tip
      
      Benchmark results on darwin/amd64:
      benchmark                                 old ns/op    new ns/op    delta
      BenchmarkInterfaces-2                         34402        31854   -7.41%
      BenchmarkInterfaceByIndex-2                   13192        12950   -1.83%
      BenchmarkInterfaceByName-2                    34791        31926   -8.23%
      BenchmarkInterfaceAddrs-2                     36565        42144  +15.26%
      BenchmarkInterfacesAndAddrs-2                 17497        17329   -0.96%
      BenchmarkInterfacesAndMulticastAddrs-2        25276        24870   -1.61%
      old: 15797:9c3930413c1b, new: tip+CL7400055
      
      Update #4234.
      Fixes #4839 (again).
      Fixes #4866.
      
      R=golang-dev, fullung
      CC=golang-dev
      https://golang.org/cl/7400055
      322214cf
    • Akshat Kumar's avatar
      net, os, syscall: Plan 9: adjust error handling · f0a8b610
      Akshat Kumar authored
      syscall: Use NewError for all system errors and introduce
              some new errors for compatibility with other packages
              and proper error handling in net. Also introduce
              Temporary and Timeout methods on ErrorString.
      
      net: Make errors from dial, accept, listen functions follow the
              OpError standard and discern whether the underlying
              error came from syscall. Since Plan 9 uses a correspondence
              between file and network operations, all system error
              reporting happens through the underlying file operation.
              In Go code, we go through package os for file operations,
              so there is another level of indirection in error types.
              This change allows us to compare the errors with those in
              package syscall, when appropriate.
      
      os: Just use the error string already present in package os,
              instead of calling out to package syscall.
      
      R=rsc, ality, rminnich, bradfitz
      CC=golang-dev
      https://golang.org/cl/7398054
      f0a8b610
    • Akshat Kumar's avatar
      syscall: Plan 9: keep a consistent environment array · 1f62a784
      Akshat Kumar authored
      Map order is non-deterministic. Introduce a new
      environment string array that tracks the env map.
      This allows us to produce identical results for
      Environ() upon successive calls, as expected by the
      TestConsistentEnviron test in package os.
      
      R=rsc, ality, rminnich, bradfitz, r
      CC=golang-dev
      https://golang.org/cl/7411047
      1f62a784
    • Tyler Bunnell's avatar
      misc/dist: handle previous installation · 65983695
      Tyler Bunnell authored
      The installer package will now detect a previous installation and warn the user
      that the previous installation will be deleted. If the user continues, the
      installer will delete the previous installation and install the package as
      usual.
      
      Fixes #4293.
      
      R=adg
      CC=golang-dev
      https://golang.org/cl/7427044
      65983695
    • Andrew Gerrand's avatar
      A+C: Tyler Bunnell (individual CLA) · 91c09649
      Andrew Gerrand authored
      Generated by addca.
      
      R=gobot
      CC=golang-dev
      https://golang.org/cl/7432043
      91c09649
    • Russ Cox's avatar
      cmd/cgo: add implementation comment · 062a2390
      Russ Cox authored
      R=golang-dev, r, bradfitz, iant
      CC=golang-dev
      https://golang.org/cl/7407050
      062a2390
    • Nigel Tao's avatar
      exp/cookiejar: eliminate some "."+str garbage. · 3b69efb0
      Nigel Tao authored
      It's not a big deal, but it's easy to fix.
      
      R=dsymonds
      CC=dr.volker.dobler, golang-dev
      https://golang.org/cl/7425043
      3b69efb0
    • Volker Dobler's avatar
      exp/cookiejar: add some more tests · 1069d25e
      Volker Dobler authored
      New tests added for port handling and IDNA domains.
      A new test case contains several redundant
      tests but provides a nice documentation of the
      implemented rules for domain handling.
      
      R=nigeltao
      CC=golang-dev
      https://golang.org/cl/7393070
      1069d25e
    • Gustavo Niemeyer's avatar
      net/http: don't drop error on request write · 64648986
      Gustavo Niemeyer authored
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7230059
      64648986
    • Rob Pike's avatar
      builtin: document appending a string to a byte slice · f12796e9
      Rob Pike authored
      Fixes #4873.
      
      R=golang-dev, bradfitz
      CC=golang-dev
      https://golang.org/cl/7421043
      f12796e9
  3. 27 Feb, 2013 4 commits