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

Function GetVarint64Ptr

tensorflow/core/lib/core/coding.cc:177–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177const char* GetVarint64Ptr(const char* p, const char* limit, uint64* value) {
178 uint64 result = 0;
179 for (uint32 shift = 0; shift <= 63 && p < limit; shift += 7) {
180 uint64 byte = *(reinterpret_cast<const unsigned char*>(p));
181 p++;
182 if (byte & 128) {
183 // More bytes are present
184 result |= ((byte & 127) << shift);
185 } else {
186 result |= (byte << shift);
187 *value = result;
188 return reinterpret_cast<const char*>(p);
189 }
190 }
191 return nullptr;
192}
193
194bool GetVarint64(StringPiece* input, uint64* value) {
195 const char* p = input->data();

Callers 4

TESTFunction · 0.85
GetVarint64Function · 0.85
ReadVarint64Method · 0.85
TF_StringDecode_ImplFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68