MCPcopy Create free account
hub / github.com/apache/fory / grow

Method grow

go/fory/buffer.go:162–167  ·  view source on GitHub ↗

grow ensures there's space for n more bytes. Hot path is inlined.

(n int)

Source from the content-addressed store, hash-verified

160
161// grow ensures there's space for n more bytes. Hot path is inlined.
162func (b *ByteBuffer) grow(n int) {
163 if b.writerIndex+n <= len(b.data) {
164 return // Fast path - single comparison, easily inlined
165 }
166 b.growSlow(n)
167}
168
169// growSlow handles the cold path when buffer expansion is needed.
170//

Callers 15

WriteBoolMethod · 0.95
WriteByteMethod · 0.95
WriteByte_Method · 0.95
WriteInt8Method · 0.95
WriteUint8Method · 0.95
WriteUint16Method · 0.95
WriteInt16Method · 0.95
WriteUint32Method · 0.95
WriteInt32Method · 0.95
WriteLengthMethod · 0.95
WriteUint64Method · 0.95
WriteInt64Method · 0.95

Calls 1

growSlowMethod · 0.95

Tested by

no test coverage detected