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

Function arenas_i2a_impl

deps/jemalloc/src/ctl.c:682–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680/******************************************************************************/
681
682static unsigned
683arenas_i2a_impl(size_t i, bool compat, bool validate) {
684 unsigned a;
685
686 switch (i) {
687 case MALLCTL_ARENAS_ALL:
688 a = 0;
689 break;
690 case MALLCTL_ARENAS_DESTROYED:
691 a = 1;
692 break;
693 default:
694 if (compat && i == ctl_arenas->narenas) {
695 /*
696 * Provide deprecated backward compatibility for
697 * accessing the merged stats at index narenas rather
698 * than via MALLCTL_ARENAS_ALL. This is scheduled for
699 * removal in 6.0.0.
700 */
701 a = 0;
702 } else if (validate && i >= ctl_arenas->narenas) {
703 a = UINT_MAX;
704 } else {
705 /*
706 * This function should never be called for an index
707 * more than one past the range of indices that have
708 * initialized ctl data.
709 */
710 assert(i < ctl_arenas->narenas || (!validate && i ==
711 ctl_arenas->narenas));
712 a = (unsigned)i + 2;
713 }
714 break;
715 }
716
717 return a;
718}
719
720static unsigned
721arenas_i2a(size_t i) {

Callers 3

arenas_i2aFunction · 0.70
arenas_i_implFunction · 0.70
ctl_arenas_i_verifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected