1. 22 Aug, 2018 3 commits
    • David Carlier's avatar
      crypto/rand: use the new getrandom syscall on FreeBSD · 64f3d75b
      David Carlier authored
      Since the 12.x branch, the getrandom syscall had been introduced
      with similar interface as Linux's and consistent syscall id
      across architectures.
      
      Change-Id: I63d6b45dbe9e29f07f1b5b6c2ec8be4fa624b9ee
      GitHub-Last-Rev: 6fb76e6522ef5ccb96d02445ffa39796dae89016
      GitHub-Pull-Request: golang/go#25976
      Reviewed-on: https://go-review.googlesource.com/120055
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      64f3d75b
    • Michael Fraenkel's avatar
      strings: use Builder in Map · 45c7d808
      Michael Fraenkel authored
      Use a builder to avoid the copy when converting the []byte to a string.
      
      name                  old time/op    new time/op    delta
      ByteByteMap-8            796ns ± 5%     700ns ± 1%  -12.00%  (p=0.000 n=9+8)
      Map/identity/ASCII-8     123ns ± 8%     126ns ± 7%     ~     (p=0.194 n=10+10)
      Map/identity/Greek-8     198ns ± 2%     204ns ± 5%   +2.99%  (p=0.008 n=9+10)
      Map/change/ASCII-8       266ns ±10%     202ns ± 3%  -24.19%  (p=0.000 n=10+10)
      Map/change/Greek-8       450ns ± 4%     406ns ± 1%   -9.73%  (p=0.000 n=9+10)
      MapNoChanges-8          85.4ns ± 3%    90.2ns ±11%   +5.67%  (p=0.000 n=9+10)
      
      name                  old alloc/op   new alloc/op   delta
      ByteByteMap-8             416B ± 0%      208B ± 0%  -50.00%  (p=0.000 n=10+10)
      Map/identity/ASCII-8     0.00B          0.00B          ~     (all equal)
      Map/identity/Greek-8     0.00B          0.00B          ~     (all equal)
      Map/change/ASCII-8        128B ± 0%       64B ± 0%  -50.00%  (p=0.000 n=10+10)
      Map/change/Greek-8        160B ± 0%       80B ± 0%  -50.00%  (p=0.000 n=10+10)
      MapNoChanges-8           0.00B          0.00B          ~     (all equal)
      
      name                  old allocs/op  new allocs/op  delta
      ByteByteMap-8             2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Map/identity/ASCII-8      0.00           0.00          ~     (all equal)
      Map/identity/Greek-8      0.00           0.00          ~     (all equal)
      Map/change/ASCII-8        2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Map/change/Greek-8        2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      MapNoChanges-8            0.00           0.00          ~     (all equal)
      
      Fixes #26304
      
      Change-Id: Ideec9dfc29b0b8107f34fc634247081d0031777d
      Reviewed-on: https://go-review.googlesource.com/122875Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      45c7d808
    • Daniël de Kok's avatar
      cmd/cgo: perform explicit conversion in _GoStringLen · d2ace0ce
      Daniël de Kok authored
      _GoStringLen performs an implicit conversion from intgo to size_t.
      Explicitly cast to size_t.
      
      This change avoids warnings when using cgo with CFLAGS:
      -Wconversion.
      
      Change-Id: I58f75a35e17f669a67f9805061c041b03eddbb5c
      GitHub-Last-Rev: b5df1ac0c3c90360fa1d22c069e0f126e9f894d8
      GitHub-Pull-Request: golang/go#27092
      Reviewed-on: https://go-review.googlesource.com/129820
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      d2ace0ce
  2. 21 Aug, 2018 37 commits