1. 05 Sep, 2017 6 commits
  2. 04 Sep, 2017 1 commit
  3. 03 Sep, 2017 4 commits
  4. 02 Sep, 2017 2 commits
    • Mark Pulford's avatar
      math: Add Round function (ties away from zero) · 03c3bb5f
      Mark Pulford authored
      This function avoids subtle faults found in many ad-hoc implementations,
      and is simple enough to be inlined by the compiler.
      
      Fixes #20100
      
      Change-Id: Ib320254e9b1f1f798c6ef906b116f63bc29e8d08
      Reviewed-on: https://go-review.googlesource.com/43652Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      03c3bb5f
    • Keith Randall's avatar
      runtime: fix hashmap load factor computation · dbe3522c
      Keith Randall authored
      overLoadFactor wasn't really doing what it says it does.
      It was reporting overOrEqualToLoadFactor.  That's actually what we
      want when adding an entry to a map, but it isn't what we want when
      constructing a map in the first place.
      
      The impetus for this change is that if you make a map with a hint
      of exactly 8 (which happens, for example, with the unitMap in
      time/format.go), we allocate 2 buckets for it instead of 1.
      
      Instead, make overLoadFactor really report when it is > the max
      allowed load factor, not >=.  Adjust the callers who want to ensure
      that the map is no more than the max load factor after an insertion
      by adding a +1 to the current (pre-addition) size.
      
      Change-Id: Ie8d85344800a9a870036b637b1031ddd9e4b93f9
      Reviewed-on: https://go-review.googlesource.com/61053
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
      dbe3522c
  5. 01 Sep, 2017 10 commits
  6. 31 Aug, 2017 14 commits
  7. 30 Aug, 2017 3 commits
    • Chris Ball's avatar
      runtime: add symbols for Linux syscall numbers on 386/amd64 · 4d269ad1
      Chris Ball authored
      Matches other architectures by using names for syscalls instead of
      numbers directly.
      
      Fixes #20499.
      
      Change-Id: I63d606b0b1fe6fb517fd994a7542a3f38d80dd54
      Reviewed-on: https://go-review.googlesource.com/44213
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      4d269ad1
    • Carlos Eduardo Seo's avatar
      runtime: fix regression in BenchmarkCompareBytes* for ppc64x · 4641d78a
      Carlos Eduardo Seo authored
      Between go1.7 and go1.8, a performance regression was introduced in some of the
      BenchmarkCompareBytes benchmarks.
      
      Go1.7 vs Go1.8:
      BenchmarkCompareBytesToNil-8               7.44          8.44          +13.44%
      BenchmarkCompareBytesIdentical-8           6.96          11.5          +65.23%
      BenchmarkCompareBytesBigIdentical-8        6.65          47112         +708351.13%
      
      This change fixes the problem by optimizing the case where the byte slices being
      compared are equal:
      
      Go1.9 vs current:
      BenchmarkCompareBytesToNil-8               7.35          7.00          -4.76%
      BenchmarkCompareBytesIdentical-8           11.4          6.81          -40.26%
      BenchmarkCompareBytesBigIdentical-8        48396         9.26          -99.98%
      
      runtime.cmpstring can benefit from the same approach and is also changed.
      
      Change-Id: I3cb25f59d8b940a83a2cf687eea764cfeff90688
      Reviewed-on: https://go-review.googlesource.com/59650
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
      4641d78a
    • Hiroshi Ioka's avatar
      cmd/cgo: support niladic function-like macros · 03876af9
      Hiroshi Ioka authored
      Currently, cgo supports only macros which can be reduced to constants
      or variables. The CL addresses remaining parts, macros which can be
      represented as niladic functions.
      
      The basic idea is simple:
        1. make a thin wrapper function per macros.
        2. replace macro expansions with function calls.
      
      Fixes #10715
      Fixes #18720
      
      Change-Id: I150b4fb48e9dc4cc34466ef6417c04ac93d4bc1a
      Reviewed-on: https://go-review.googlesource.com/43970
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      03876af9