*/
#include <atomic>
+#include <cstring>
#include <errno.h>
#include <limits.h>
}
}
+ bool buffer::list::contents_equal(const void* const other,
+ size_t length) const
+ {
+ if (this->length() != length) {
+ return false;
+ }
+
+ const auto* other_buf = reinterpret_cast<const char*>(other);
+ for (const auto& bp : buffers()) {
+ const auto round_length = std::min<size_t>(length, bp.length());
+ if (std::memcmp(bp.c_str(), other_buf, round_length) != 0) {
+ return false;
+ } else {
+ length -= round_length;
+ other_buf += round_length;
+ }
+ }
+
+ return true;
+ }
+
bool buffer::list::is_provided_buffer(const char* const dst) const
{
if (_buffers.empty()) {
}
bool contents_equal(const buffer::list& other) const;
+ bool contents_equal(const void* other, size_t length) const;
bool is_provided_buffer(const char *dst) const;
bool is_aligned(unsigned align) const;