]> Cypherpunks repositories - gostls13.git/commit
runtime: fix tiny allocator
authorMatthew Dempsky <mdempsky@google.com>
Mon, 26 Oct 2015 19:38:47 +0000 (12:38 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 26 Oct 2015 21:14:15 +0000 (21:14 +0000)
commitd18167fefea5e77388dbc1e323e8527b58494185
treed7f7b1e5718ef3bc87d8cd02af06e90b02f1a482
parente6ccfc1ad14d1078428fe5f408498f925ab69670
runtime: fix tiny allocator

When a new tiny block is allocated because we're allocating an object
that won't fit into the current block, mallocgc saves the new block if
it has more space leftover than the old block.  However, the logic for
this was subtly broken in golang.org/cl/2814, resulting in never
saving (or consequently reusing) a tiny block.

Change-Id: Ib5f6769451fb82877ddeefe75dfe79ed4a04fd40
Reviewed-on: https://go-review.googlesource.com/16330
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/malloc.go
src/runtime/malloc_test.go