MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ctl_byname

Function ctl_byname

deps/jemalloc/src/ctl.c:1291–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289}
1290
1291int
1292ctl_byname(tsd_t *tsd, const char *name, void *oldp, size_t *oldlenp,
1293 void *newp, size_t newlen) {
1294 int ret;
1295 size_t depth;
1296 ctl_node_t const *nodes[CTL_MAX_DEPTH];
1297 size_t mib[CTL_MAX_DEPTH];
1298 const ctl_named_node_t *node;
1299
1300 if (!ctl_initialized && ctl_init(tsd)) {
1301 ret = EAGAIN;
1302 goto label_return;
1303 }
1304
1305 depth = CTL_MAX_DEPTH;
1306 ret = ctl_lookup(tsd_tsdn(tsd), name, nodes, mib, &depth);
1307 if (ret != 0) {
1308 goto label_return;
1309 }
1310
1311 node = ctl_named_node(nodes[depth-1]);
1312 if (node != NULL && node->ctl) {
1313 ret = node->ctl(tsd, mib, depth, oldp, oldlenp, newp, newlen);
1314 } else {
1315 /* The name refers to a partial path through the ctl tree. */
1316 ret = ENOENT;
1317 }
1318
1319label_return:
1320 return(ret);
1321}
1322
1323int
1324ctl_nametomib(tsd_t *tsd, const char *name, size_t *mibp, size_t *miblenp) {

Callers 1

je_mallctlFunction · 0.70

Calls 4

ctl_initFunction · 0.70
ctl_lookupFunction · 0.70
ctl_named_nodeFunction · 0.70
tsd_tsdnFunction · 0.50

Tested by

no test coverage detected