MCPcopy Create free account
hub / github.com/apache/fory / ensure_offset_readable

Function ensure_offset_readable

cpp/fory/serialization/struct_serializer.h:3914–3923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3912
3913template <size_t Bytes>
3914FORY_ALWAYS_INLINE bool ensure_offset_readable(Buffer &buffer, uint32_t offset,
3915 Error &error) {
3916 static_assert(Bytes > 0, "Bytes must be positive");
3917 if (FORY_PREDICT_FALSE(offset > buffer.size() ||
3918 buffer.size() - offset < Bytes)) {
3919 error.set_buffer_out_of_bound(offset, Bytes, buffer.size());
3920 return false;
3921 }
3922 return true;
3923}
3924
3925FORY_ALWAYS_INLINE uint64_t read_tagged_uint64_at_checked(Buffer &buffer,
3926 uint32_t &offset,

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45

Tested by

no test coverage detected