OutMessage.GrowNoZero

geesefs-0-30-9
Aaron Jacobs 2015-07-28 16:24:45 +10:00
parent 9a55ffcd7d
commit e2aa0ec1be
1 changed files with 8 additions and 1 deletions

View File

@ -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!
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