]> Cypherpunks repositories - gostls13.git/commit
runtime: compute size classes statically
authorKeith Randall <khr@golang.org>
Thu, 27 Oct 2016 04:25:56 +0000 (21:25 -0700)
committerKeith Randall <khr@golang.org>
Sun, 30 Oct 2016 03:48:49 +0000 (03:48 +0000)
commit7ba36f4adb43355ef4b870d64d23f9988b1279ea
tree6cba94b528c17a72497235cdb3ffb2b3a8495a33
parent753caecc7e576e46a329b71c49dbf0ea9bfbd867
runtime: compute size classes statically

No point in computing this info on startup.
Compute it at build time.
This lets us spend more time computing & checking the size classes.

Improve the div magic for rounding to the start of an object.
We can now use 32-bit multiplies & shifts, which should help
32-bit platforms.

The static data is <1KB.

The actual size classes are not changed by this CL.

Change-Id: I6450cec7d1b2b4ad31fd3f945f504ed2ec6570e7
Reviewed-on: https://go-review.googlesource.com/32219
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/malloc.go
src/runtime/mbitmap.go
src/runtime/mheap.go
src/runtime/mksizeclasses.go [new file with mode: 0644]
src/runtime/msize.go
src/runtime/sizeclasses.go [new file with mode: 0644]