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

Function xstrndup

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

Source from the content-addressed store, hash-verified

99
100static void *xrealloc(void *p, size_t n) {
101 void *q = realloc(p, n ? n : 1);
102 if (!q) die("out of memory");
103 return q;
104}
105
106static char *xstrdup(const char *s) {
107 size_t n = strlen(s);
108 char *p = xmalloc(n + 1);
109 memcpy(p, s, n + 1);

Callers 1

json_strdup_tokFunction · 0.70

Calls 1

xmallocFunction · 0.70

Tested by

no test coverage detected