1. 20 Sep, 2019 3 commits
    • Emmanuel T Odeke's avatar
      debug/dwarf: optimize buf.string · 0d9981bc
      Emmanuel T Odeke authored
      (*buf).string previously manually searched
      through its underlying byte slice until we
      encountered a '0'. This change instead uses
      bytes.IndexByte that results in a speed up:
      
      $ benchstat before.txt after.txt
      
      name         old time/op    new time/op    delta
      BufString-8     257ns ± 1%     174ns ± 1%  -32.37%  (p=0.000 n=9+8)
      
      name         old speed      new speed      delta
      BufString-8   495MB/s ± 1%   732MB/s ± 1%  +47.76%  (p=0.000 n=10+8)
      
      name         old alloc/op   new alloc/op   delta
      BufString-8      162B ± 0%      162B ± 0%     ~     (all equal)
      
      name         old allocs/op  new allocs/op  delta
      BufString-8      3.00 ± 0%      3.00 ± 0%     ~     (all equal)
      
      Change-Id: I7cf241742cc091d5d30d987a168b02d83955b1cf
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196657
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
      0d9981bc
    • Rob Pike's avatar
      doc: reword to avoid the confusing term 'anew' · bb0a8fd3
      Rob Pike authored
      Fixes #34415
      
      Change-Id: I8eaa7606ae01e569a076cf7f3c28dbec2a153001
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196578Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
      bb0a8fd3
    • Ian Lance Taylor's avatar
      runtime: avoid overflow in markrootBlock · 66e562cc
      Ian Lance Taylor authored
      In a position independent executable the data or BSS may be located
      close to the end of memory. If it is placed closer than
      rootBlockBytes, then the calculations in markrootBlock would overflow,
      and the test that ensures that n is not larger than n0 would fail.
      This would then cause scanblock to scan data that it shouldn't,
      using an effectively random ptrmask, leading to program crashes.
      
      No test because the only way to test it is to build a PIE and convince
      the kernel to put the data section near the end of memory, and I don't
      know how to do that. Or perhaps we could use a linker script, but that
      is painful.
      
      The new code is algebraically identical to the original code, but
      avoids the potential overflow of b+rootBlockBytes.
      
      Change-Id: Ieb4e5465174bb762b063d2491caeaa745017345e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/195717
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      66e562cc
  2. 19 Sep, 2019 12 commits
  3. 18 Sep, 2019 24 commits
  4. 17 Sep, 2019 1 commit
    • Robert Griesemer's avatar
      go/types: make sure interfaces are complete before comparing them · 04fb929a
      Robert Griesemer authored
      Complete interfaces before comparing them with Checker.identical.
      This requires passing through a *Checker to various functions that
      didn't need this before.
      
      Verified that none of the exported API entry points for interfaces
      that rely on completed interfaces are used internally except for
      Interface.Empty. Verified that interfaces are complete before
      calling Empty on them, and added a dynamic check in the exported
      functions.
      
      Unfortunately, this fix exposed another problem with an esoteric
      test case (#33656) which we need to reopen.
      
      Fixes #34151.
      Updates #33656.
      
      Change-Id: I4e14bae3df74a2c21b565c24fdd07135f22e11c0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/195837
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      04fb929a