| 613 | } |
| 614 | |
| 615 | void IOBuf::clear() { |
| 616 | if (_small()) { |
| 617 | if (_sv.refs[0].block != NULL) { |
| 618 | _sv.refs[0].block->dec_ref(); |
| 619 | reset_block_ref(_sv.refs[0]); |
| 620 | |
| 621 | if (_sv.refs[1].block != NULL) { |
| 622 | _sv.refs[1].block->dec_ref(); |
| 623 | reset_block_ref(_sv.refs[1]); |
| 624 | } |
| 625 | } |
| 626 | } else { |
| 627 | for (uint32_t i = 0; i < _bv.nref; ++i) { |
| 628 | _bv.ref_at(i).block->dec_ref(); |
| 629 | } |
| 630 | iobuf::release_blockref_array(_bv.refs, _bv.capacity()); |
| 631 | new (this) IOBuf; |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | size_t IOBuf::pop_front(size_t n) { |
| 636 | const size_t len = length(); |
nothing calls this directly
no test coverage detected