| 191 | } |
| 192 | |
| 193 | inline void |
| 194 | resize(std::size_t n) |
| 195 | { |
| 196 | if (n > capacity_) { |
| 197 | std::unique_ptr<char[], void(*)(void*)> tmp( |
| 198 | reinterpret_cast<char*>(aligned_alloc(alignof(struct nlmsghdr), n)), |
| 199 | std::free); |
| 200 | std::memcpy(tmp.get(), buf_.get(), capacity_); |
| 201 | capacity_ = n; |
| 202 | buf_.swap(tmp); |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | inline std::size_t capacity() const { return capacity_; } |
| 207 |
no test coverage detected