1. 01 Dec, 2015 2 commits
  2. 30 Nov, 2015 7 commits
  3. 29 Nov, 2015 3 commits
  4. 28 Nov, 2015 5 commits
  5. 27 Nov, 2015 2 commits
  6. 26 Nov, 2015 8 commits
  7. 25 Nov, 2015 13 commits
    • Michael Hudson-Doyle's avatar
      syscall: skip tests that create a user namespace when chrooted · 21efa7b2
      Michael Hudson-Doyle authored
      The kernel rejects attempts to create user namespaces when in a chroot.
      
      Change-Id: I6548302732c8f5be52f4167cd7233aea16839ad8
      Reviewed-on: https://go-review.googlesource.com/17214Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      21efa7b2
    • Matthew Dempsky's avatar
      doc: update go1.6.txt for cmd/cgo's C.complexfloat and C.complexdouble fix · 240144a3
      Matthew Dempsky authored
      Updates #13402.
      
      Change-Id: Ia7b729d81fb78206d214444911f2e6573b88717a
      Reviewed-on: https://go-review.googlesource.com/17240Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      240144a3
    • Matthew Dempsky's avatar
      cmd/cgo: fix C.complexfloat and C.complexdouble · 10cb39af
      Matthew Dempsky authored
      This also fixes an unintended behavior where C's "complex float" and
      "complex double" types were interchangeable with Go's "complex64" and
      "complex128" types.
      
      Fixes #13402.
      
      Change-Id: I73f96d9a4772088d495073783c6982e9634430e8
      Reviewed-on: https://go-review.googlesource.com/17208Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      10cb39af
    • Matthew Dempsky's avatar
      cmd/cgo: handle another Clang DWARF quirk · de640d36
      Matthew Dempsky authored
      Without the fix:
      
          $ CC=clang-3.5 ./test.bash
          misc/cgo/errors/test.bash: BUG: expected error output to contain "C.ushort" but saw:
          # command-line-arguments
          ./issue13129.go:13: cannot use int(0) (type int) as type C.unsignedshort in assignment
      
      Fixes #13129.
      
      Change-Id: I2c019d2d000f5bfa3e33c477e533aff97031a84f
      Reviewed-on: https://go-review.googlesource.com/17207
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      de640d36
    • Robert Griesemer's avatar
      cmd/compile: clearer error for invalid array/slice literal elements · c7a34031
      Robert Griesemer authored
      Fixes #13365.
      
      Change-Id: I5a447ff806dbbb11c8c75e2b5cfa7fd4a845fb92
      Reviewed-on: https://go-review.googlesource.com/17206
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c7a34031
    • Caleb Spare's avatar
      regexp: fix one-pass compilation · e36bf614
      Caleb Spare authored
      The one-pass transformation is structured as a search over the input
      machine for conditions that violate the one-pass requisites. At each
      iteration, we should fully explore all non-input paths that proceed from
      the current instruction; this is implemented via recursive check calls.
      But when we reach instructions that demand input (InstRune*), these
      should be put onto the search queue.
      
      Instead of searching this way, the routine previously (effectively)
      proceeded through the machine one instruction at a time until finding an
      Inst{Match,Fail,Rune*}, calling check on each instruction. This caused
      bug #11905, where the transformation stopped before rewriting all
      InstAlts as InstAltMatches.
      
      Further, the check function unnecessarily recurred on InstRune*
      instructions. (I believe this helps to mask the above bug.)
      
      This change also deletes some unused functions and duplicate test cases.
      
      Fixes #11905.
      
      Change-Id: I5b0b26efea3d3bd01c7479a518b5ed1b886701cd
      Reviewed-on: https://go-review.googlesource.com/17195Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      e36bf614
    • Caleb Spare's avatar
      regexp: fix LiteralPrefix for certain onepass progs · d1eedfe1
      Caleb Spare authored
      The prefix computation for onepass was incorrectly returning
      complete=true when it encountered a beginning-of-text empty width match
      (^) in the middle of an expression.
      
      Fix by returning complete only when the prefix is followed by $ and then
      an accepting state.
      
      Fixes #11175.
      
      Change-Id: Ie9c4cf5f76c1d2c904a6fb2f016cedb265c19fde
      Reviewed-on: https://go-review.googlesource.com/16200
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      d1eedfe1
    • Caleb Spare's avatar
      regexp: add Copy method to Regexp · 937172b2
      Caleb Spare authored
      This helps users who wish to use separate Regexps in each goroutine to
      avoid lock contention. Previously they had to parse the expression
      multiple times to achieve this.
      
      I used variants of the included benchmark to evaluate this change. I
      used the arguments -benchtime 20s -cpu 1,2,4,8,16 on a machine with 16
      hardware cores.
      
      Comparing a single shared Regexp vs. copied Regexps, we can see that
      lock contention causes huge slowdowns at higher levels of parallelism.
      The copied version shows the expected linear speedup.
      
      name              old time/op  new time/op  delta
      MatchParallel      366ns ± 0%   370ns ± 0%   +1.09%   (p=0.000 n=10+8)
      MatchParallel-2    324ns ±28%   184ns ± 1%  -43.37%  (p=0.000 n=10+10)
      MatchParallel-4    352ns ± 5%    93ns ± 1%  -73.70%   (p=0.000 n=9+10)
      MatchParallel-8    480ns ± 3%    46ns ± 0%  -90.33%    (p=0.000 n=9+8)
      MatchParallel-16   510ns ± 8%    24ns ± 6%  -95.36%   (p=0.000 n=10+8)
      
      I also compared a modified version of Regexp that has no mutex and a
      single machine (the "RegexpForSingleGoroutine" rsc mentioned in
      https://github.com/golang/go/issues/8232#issuecomment-66096128).
      
      In this next test, I compared using N copied Regexps vs. N separate
      RegexpForSingleGoroutines. This shows that, even for this relatively
      simple regex, avoiding the lock entirely would only buy about 10-12%
      further improvement.
      
      name              old time/op  new time/op  delta
      MatchParallel      370ns ± 0%   322ns ± 0%  -12.97%    (p=0.000 n=8+8)
      MatchParallel-2    184ns ± 1%   162ns ± 1%  -11.60%  (p=0.000 n=10+10)
      MatchParallel-4   92.7ns ± 1%  81.1ns ± 2%  -12.43%  (p=0.000 n=10+10)
      MatchParallel-8   46.4ns ± 0%  41.8ns ±10%   -9.78%   (p=0.000 n=8+10)
      MatchParallel-16  23.7ns ± 6%  20.6ns ± 1%  -13.14%    (p=0.000 n=8+8)
      
      Updates #8232.
      
      Change-Id: I15201a080c363d1b44104eafed46d8df5e311902
      Reviewed-on: https://go-review.googlesource.com/16110Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      937172b2
    • Tamir Duberstein's avatar
      regexp/syntax: correctly print `^` BOL and `$` EOL · 3aa755b8
      Tamir Duberstein authored
      Fixes #12980.
      
      Change-Id: I936db2f57f7c4dc80bb8ec32715c4c6b7bf0d708
      Reviewed-on: https://go-review.googlesource.com/16112Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      3aa755b8
    • Giulio Iotti's avatar
      encoding/xml: case-insensitive encoding recognition · 0b55be1b
      Giulio Iotti authored
      From the XML spec: "XML processors should match character encoding
      names in a case-insensitive way"
      
      Fixes #12417.
      
      Change-Id: I678c50152a49c14364be62b3f21ab9b9b009b24b
      Reviewed-on: https://go-review.googlesource.com/14084Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      0b55be1b
    • Michal Bohuslávek's avatar
      encoding/xml: reject invalid comments · 97c859f8
      Michal Bohuslávek authored
      Fixes #11112.
      
      Change-Id: I16e7363549a0dec8c61addfa14af0866c1fd7c40
      Reviewed-on: https://go-review.googlesource.com/14173Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      97c859f8
    • Charles Weill's avatar
      encoding/xml: Add CDATA-wrapper output support to xml.Marshal. · 3f6b91b1
      Charles Weill authored
      Fixes #12963
      
      Change-Id: Icc50dfb6130fe1e189d45f923c2f7408d3cf9401
      Reviewed-on: https://go-review.googlesource.com/16047Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      3f6b91b1
    • Aliaksandr Valialkin's avatar
      encoding/gob: reduce the amount of memory allocations. · a48de745
      Aliaksandr Valialkin authored
      Benchmark results:
      
      benchmark                              old ns/op     new ns/op     delta
      BenchmarkEndToEndPipe-4                7547          7294          -3.35%
      BenchmarkEndToEndByteBuffer-4          5146          5092          -1.05%
      BenchmarkEndToEndSliceByteBuffer-4     552779        439768        -20.44%
      BenchmarkEncodeComplex128Slice-4       266370        266184        -0.07%
      BenchmarkEncodeFloat64Slice-4          111891        110258        -1.46%
      BenchmarkEncodeInt32Slice-4            74482         74080         -0.54%
      BenchmarkEncodeStringSlice-4           84404         84279         -0.15%
      BenchmarkEncodeInterfaceSlice-4        3942925       3045995       -22.75%
      BenchmarkDecodeComplex128Slice-4       451837        415282        -8.09%
      BenchmarkDecodeFloat64Slice-4          283584        262558        -7.41%
      BenchmarkDecodeInt32Slice-4            246571        237383        -3.73%
      BenchmarkDecodeStringSlice-4           734210        479625        -34.67%
      BenchmarkDecodeInterfaceSlice-4        4778225       4160935       -12.92%
      
      benchmark                              old allocs     new allocs     delta
      BenchmarkEndToEndPipe-4                3              2              -33.33%
      BenchmarkEndToEndByteBuffer-4          3              2              -33.33%
      BenchmarkEndToEndSliceByteBuffer-4     1002           402            -59.88%
      BenchmarkEncodeComplex128Slice-4       1              1              +0.00%
      BenchmarkEncodeFloat64Slice-4          1              1              +0.00%
      BenchmarkEncodeInt32Slice-4            1              1              +0.00%
      BenchmarkEncodeStringSlice-4           1              1              +0.00%
      BenchmarkEncodeInterfaceSlice-4        3001           1              -99.97%
      BenchmarkDecodeComplex128Slice-4       188            185            -1.60%
      BenchmarkDecodeFloat64Slice-4          188            185            -1.60%
      BenchmarkDecodeInt32Slice-4            188            185            -1.60%
      BenchmarkDecodeStringSlice-4           2188           1185           -45.84%
      BenchmarkDecodeInterfaceSlice-4        6197           4194           -32.32%
      
      benchmark                              old bytes     new bytes     delta
      BenchmarkEndToEndPipe-4                64            48            -25.00%
      BenchmarkEndToEndByteBuffer-4          64            48            -25.00%
      BenchmarkEndToEndSliceByteBuffer-4     34551         10554         -69.45%
      BenchmarkEncodeComplex128Slice-4       55            55            +0.00%
      BenchmarkEncodeFloat64Slice-4          33            33            +0.00%
      BenchmarkEncodeInt32Slice-4            32            32            +0.00%
      BenchmarkEncodeStringSlice-4           36            36            +0.00%
      BenchmarkEncodeInterfaceSlice-4        144555        347           -99.76%
      BenchmarkDecodeComplex128Slice-4       28240         28097         -0.51%
      BenchmarkDecodeFloat64Slice-4          11840         11697         -1.21%
      BenchmarkDecodeInt32Slice-4            10817         10673         -1.33%
      BenchmarkDecodeStringSlice-4           56128         39985         -28.76%
      BenchmarkDecodeInterfaceSlice-4        132565        100421        -24.25%
      
      Change-Id: Ief7c7706b1f2916486ab7190b81aafbb16b70f1e
      Reviewed-on: https://go-review.googlesource.com/13660Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      a48de745