| 208 | } |
| 209 | |
| 210 | void Swap(MessageBuilder &other) { |
| 211 | slice_allocator_.swap(other.slice_allocator_); |
| 212 | FlatBufferBuilder::Swap(other); |
| 213 | // After swapping the FlatBufferBuilder, we swap back the allocator, which |
| 214 | // restores the original allocator back in place. This is necessary because |
| 215 | // MessageBuilder's allocator is its own member (SliceAllocatorMember). The |
| 216 | // allocator passed to FlatBufferBuilder::vector_downward must point to this |
| 217 | // member. |
| 218 | buf_.swap_allocator(other.buf_); |
| 219 | } |
| 220 | |
| 221 | // Releases the ownership of the buffer pointer. |
| 222 | // Returns the size, offset, and the original grpc_slice that |
no test coverage detected