]> Cypherpunks repositories - gostls13.git/commit
runtime: special case allocation of arrays of size 1
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 17 Jul 2017 03:46:52 +0000 (17:46 -1000)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 14 Aug 2017 23:32:03 +0000 (23:32 +0000)
commit29e9b89b9ada73fa7775b351c100709c330c0a46
treee5ba3ae68b465dcca720be7bec91410ddf059d16
parent733567a1860956e87daa1a2fa46d58fc44b896cc
runtime: special case allocation of arrays of size 1

This avoids division and multiplication.
Instrumentation suggests that this is a very common case.

Change-Id: I2d5d5012d4f4df4c4af1f9f85ca9c323c9889c0e
Reviewed-on: https://go-review.googlesource.com/54657
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/malloc.go