From 295d160e017edce29b3dccfa7bb7a9e5d9434b26 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 17 Jun 2016 09:33:33 -0400 Subject: runtime: make _TinySizeClass an int8 to prevent use as spanClass Currently _TinySizeClass is untyped, which means it can accidentally be used as a spanClass (not that I would know this from experience or anything). Make it an int8 to avoid this mix up. This is a cherry-pick of dev.garbage commit 81b74bf9c5. Change-Id: I1e69eccee436ea5aa45e9a9828a013e369e03f1a Reviewed-on: https://go-review.googlesource.com/41254 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/malloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index ea0d585ed9..3a533d9100 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -111,7 +111,7 @@ const ( // Tiny allocator parameters, see "Tiny allocator" comment in malloc.go. _TinySize = 16 - _TinySizeClass = 2 + _TinySizeClass = int8(2) _FixAllocChunk = 16 << 10 // Chunk size for FixAlloc _MaxMHeapList = 1 << (20 - _PageShift) // Maximum page length for fixed-size list in MHeap. -- cgit v1.3