_len(other._len),
_memcopy_count(other._memcopy_count),
last_p(this) {
- append_buffer.swap(other.append_buffer);
other.clear();
}
std::swap(_len, other._len);
std::swap(_memcopy_count, other._memcopy_count);
_buffers.swap(other._buffers);
- append_buffer.swap(other.append_buffer);
//last_p.swap(other.last_p);
last_p = begin();
other.last_p = other.begin();
void buffer::list::reassign_to_mempool(int pool)
{
- if (append_buffer.get_raw()) {
- append_buffer.get_raw()->reassign_to_mempool(pool);
- }
for (auto& p : _buffers) {
p.get_raw()->reassign_to_mempool(pool);
}
void buffer::list::try_assign_to_mempool(int pool)
{
- if (append_buffer.get_raw()) {
- append_buffer.get_raw()->try_assign_to_mempool(pool);
- }
for (auto& p : _buffers) {
p.get_raw()->try_assign_to_mempool(pool);
}
buffers_t _buffers;
unsigned _len;
unsigned _memcopy_count; //the total of memcopy using rebuild().
- ptr append_buffer; // where i put small appends.
template <bool is_const>
class CEPH_BUFFER_API iterator_impl {
_len = other._len;
_memcopy_count = other._memcopy_count;
last_p = begin();
- append_buffer.swap(other.append_buffer);
other.clear();
return *this;
}
_len = 0;
_memcopy_count = 0;
last_p = begin();
- append_buffer = ptr();
}
void push_back(const ptr& bp) {
if (bp.length() == 0)