MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / strnlength

Function strnlength

mlx/data/core/TARReader.cpp:12–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace {
12size_t strnlength(const char* s, size_t n) {
13 const char* found = (const char*)std::memchr(s, '\0', n);
14 return found ? (size_t)(found - s) : n;
15}
16
17size_t parse_payload_size(unsigned char* str, int len) {
18 // "first bit set" means large file (GNU tar)

Callers 1

index_workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected