MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ReadVarint32

Method ReadVarint32

tensorflow/core/lib/io/inputbuffer.h:111–122  ·  view source on GitHub ↗

Inlined for performance.

Source from the content-addressed store, hash-verified

109
110// Inlined for performance.
111inline Status InputBuffer::ReadVarint32(uint32* result) {
112 if (pos_ + core::kMaxVarint32Bytes <= limit_) {
113 // Fast path: directly parse from buffered data.
114 // Reads strictly from the range [pos_, limit_).
115 const char* offset = core::GetVarint32Ptr(pos_, limit_, result);
116 if (offset == nullptr) return errors::OutOfRange("Parsed past limit.");
117 pos_ = const_cast<char*>(offset);
118 return Status::OK();
119 } else {
120 return ReadVarint32Fallback(result);
121 }
122}
123
124// Inlined for performance.
125inline Status InputBuffer::ReadVarint64(uint64* result) {

Callers 15

TESTFunction · 0.80
SkipBytesMethod · 0.80
SkipValueMethod · 0.80
ParseTensorSubmessageMethod · 0.80
ParseFastMethod · 0.80
ParseBytesListMethod · 0.80
ParseFloatListMethod · 0.80
ParseInt64ListMethod · 0.80
SkipExtraneousTagFunction · 0.80
ParseStringFunction · 0.80
ParseFeatureMapEntryFunction · 0.80

Calls 1

GetVarint32PtrFunction · 0.85

Tested by 1

TESTFunction · 0.64