| 174 | } |
| 175 | |
| 176 | IOBufSample* IOBufSample::Copy(IOBufSample* ref) { |
| 177 | auto copied = IOBufSample::New(); |
| 178 | copied->block = ref->block; |
| 179 | copied->count = ref->count; |
| 180 | copied->_hash_code = ref->_hash_code; |
| 181 | copied->nframes = ref->nframes; |
| 182 | iobuf::cp(copied->stack, ref->stack, sizeof(void*) * ref->nframes); |
| 183 | return copied; |
| 184 | } |
| 185 | |
| 186 | IOBufRefSampleSharedPtr IOBufSample::CopyAndSharedWithDestroyer(IOBufSample* ref) { |
| 187 | return { Copy(ref), detail::Destroyer() }; |