MCPcopy Create free account
hub / github.com/dfinity/ic / resize

Method resize

cpp/infogetty-cpp/network_info.cc:193–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

recv_netlink_msgFunction · 0.45

Calls 2

swapMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected