Commit e2aa0ec1 authored by Aaron Jacobs's avatar Aaron Jacobs

OutMessage.GrowNoZero

parent 9a55ffcd
...@@ -75,7 +75,14 @@ func (b *OutMessage) Grow(size uintptr) (p unsafe.Pointer) { ...@@ -75,7 +75,14 @@ func (b *OutMessage) Grow(size uintptr) (p unsafe.Pointer) {
// Equivalent to Grow, except the new segment is not zeroed. Use with caution! // Equivalent to Grow, except the new segment is not zeroed. Use with caution!
func (b *OutMessage) GrowNoZero(size uintptr) (p unsafe.Pointer) { func (b *OutMessage) GrowNoZero(size uintptr) (p unsafe.Pointer) {
panic("TODO") if outMessageSize-b.offset < size {
return
}
p = unsafe.Pointer(uintptr(unsafe.Pointer(&b.storage)) + b.offset)
b.offset += size
return
} }
// Equivalent to growing by the length of p, then copying p over the new // Equivalent to growing by the length of p, then copying p over the new
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment