...
Source file
src/runtime/msize.go
Documentation: runtime
1
2
3
4
5
6
7
8
9
10 package runtime
11
12
13 func roundupsize(size uintptr) uintptr {
14 if size < _MaxSmallSize {
15 if size <= smallSizeMax-8 {
16 return uintptr(class_to_size[size_to_class8[divRoundUp(size, smallSizeDiv)]])
17 } else {
18 return uintptr(class_to_size[size_to_class128[divRoundUp(size-smallSizeMax, largeSizeDiv)]])
19 }
20 }
21 if size+_PageSize < size {
22 return size
23 }
24 return alignUp(size, _PageSize)
25 }
26
View as plain text