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