1. 05 Sep, 2017 3 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 6 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
    • Joe Tsai's avatar
      archive/tar: minor doc fixes · c1679286
      Joe Tsai authored
      Use "file" consistently instead of "entry".
      
      Change-Id: Ia81c9665d0d956adb78f7fa49de40cdb87fba000
      Reviewed-on: https://go-review.googlesource.com/60150Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c1679286
    • Joe Tsai's avatar
      archive/tar: require opt-in to PAX or GNU format for time features · f85dc050
      Joe Tsai authored
      Nearly every Header obtained from FileInfoHeader via the FS has
      timestamps with sub-second resolution and the AccessTime
      and ChangeTime fields populated. This forces the PAX format
      to almost always be used, which has the following problems:
      * PAX is still not as widely supported compared to USTAR
      * The PAX headers will occupy at minimum 1KiB for every entry
      
      The old behavior of tar Writer had no support for sub-second resolution
      nor any support for AccessTime or ChangeTime, so had neither problem.
      Instead the Writer would just truncate sub-second information and
      ignore the AccessTime and ChangeTime fields.
      
      In this CL, we preserve the behavior such that the *default* behavior
      would output a USTAR header for most cases by truncating sub-second
      time measurements and ignoring AccessTime and ChangeTime.
      To use either of the features, users will need to explicitly specify
      that the format is PAX or GNU.
      
      The exact policy chosen is this:
      * USTAR and GNU may still be chosen even if sub-second measurements
      are present; they simply truncate the timestamp to the nearest second.
      As before, PAX uses sub-second resolutions.
      * If the Format is unspecified, then WriteHeader ignores AccessTime
      and ChangeTime when using the USTAR format.
      
      This ensures that USTAR may still be chosen for a vast majority of
      file entries obtained through FileInfoHeader.
      
      Updates #11171
      Updates #17876
      
      Change-Id: Icc5274d4245922924498fd79b8d3ae94d5717271
      Reviewed-on: https://go-review.googlesource.com/59230
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      f85dc050
    • Marvin Stenger's avatar
      runtime/internal/sys: use standard generated code header · 0592a1a3
      Marvin Stenger authored
      This change implements the convention for generated code header agreed upon in https://golang.org/s/generatedcode.
      Additionally run go generate.
      Also update some comments.
      
      Updates #13560
      
      Change-Id: If45f91b93aaa0d43280c2c4630823bc4d2dc7d3a
      Reviewed-on: https://go-review.googlesource.com/60250
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0592a1a3