MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack-memory-calculator / String

Method String

memory/size.go:66–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66func (s Size) String() string {
67 b := int64(s) / Kibi
68
69 if b == 0 {
70 return "0"
71 }
72
73 if b%Gibi == 0 {
74 return fmt.Sprintf("%dT", b/Gibi)
75 }
76
77 if b%Mibi == 0 {
78 return fmt.Sprintf("%dG", b/Mibi)
79 }
80
81 if b%Kibi == 0 {
82 return fmt.Sprintf("%dM", b/Kibi)
83 }
84
85 return fmt.Sprintf("%dK", b)
86}

Callers 9

mainFunction · 0.45
outputFunction · 0.45
ParseSizeFunction · 0.45
TestMaxDirectMemoryFunction · 0.45
TestStackFunction · 0.45
TestMemorySizeFunction · 0.45
TestMaxHeapFunction · 0.45
TestMaxMetaspaceFunction · 0.45
TestReservedCodeCacheFunction · 0.45

Calls

no outgoing calls

Tested by 6

TestMaxDirectMemoryFunction · 0.36
TestStackFunction · 0.36
TestMemorySizeFunction · 0.36
TestMaxHeapFunction · 0.36
TestMaxMetaspaceFunction · 0.36
TestReservedCodeCacheFunction · 0.36