MCPcopy Create free account
hub / github.com/F-Stack/f-stack / arenas_i2a_impl

Function arenas_i2a_impl

app/redis-6.2.6/deps/jemalloc/src/ctl.c:598–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596/******************************************************************************/
597
598static unsigned
599arenas_i2a_impl(size_t i, bool compat, bool validate) {
600 unsigned a;
601
602 switch (i) {
603 case MALLCTL_ARENAS_ALL:
604 a = 0;
605 break;
606 case MALLCTL_ARENAS_DESTROYED:
607 a = 1;
608 break;
609 default:
610 if (compat && i == ctl_arenas->narenas) {
611 /*
612 * Provide deprecated backward compatibility for
613 * accessing the merged stats at index narenas rather
614 * than via MALLCTL_ARENAS_ALL. This is scheduled for
615 * removal in 6.0.0.
616 */
617 a = 0;
618 } else if (validate && i >= ctl_arenas->narenas) {
619 a = UINT_MAX;
620 } else {
621 /*
622 * This function should never be called for an index
623 * more than one past the range of indices that have
624 * initialized ctl data.
625 */
626 assert(i < ctl_arenas->narenas || (!validate && i ==
627 ctl_arenas->narenas));
628 a = (unsigned)i + 2;
629 }
630 break;
631 }
632
633 return a;
634}
635
636static unsigned
637arenas_i2a(size_t i) {

Callers 3

arenas_i2aFunction · 0.85
arenas_i_implFunction · 0.85
stats_arenas_i_indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected