MCPcopy Create free account
hub / github.com/antirez/ds4 / hmap_build

Function hmap_build

gguf-tools/deepseek4-quantize.c:345–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344static int json_obj_get(const json_doc *d, int obj, const char *key) {
345 if (obj < 0 || d->v[obj].type != JT_OBJECT) return -1;
346 for (int i = obj + 1; i < d->len && d->v[i].parent == obj;) {
347 int k = i;
348 int v = i + 1;
349 if (v >= d->len || d->v[v].parent != obj) return -1;
350 if (json_tok_eq(d, k, key)) return v;
351 i = json_skip(d, v);
352 }
353 return -1;
354}
355
356static int64_t json_i64(const json_doc *d, int tok) {
357 char tmp[64];
358 const int n = d->v[tok].end - d->v[tok].start;
359 if (n <= 0 || n >= (int)sizeof(tmp)) die("bad JSON integer");
360 memcpy(tmp, d->js + d->v[tok].start, (size_t)n);

Callers 4

shard_loadFunction · 0.85
db_openFunction · 0.85
imatrix_loadFunction · 0.85
load_gguf_metadataFunction · 0.85

Calls 2

fnv1a_strFunction · 0.85
xcallocFunction · 0.70

Tested by

no test coverage detected