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

Function ctl_arena_init

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

Source from the content-addressed store, hash-verified

882}
883
884static unsigned
885ctl_arena_init(tsd_t *tsd, extent_hooks_t *extent_hooks) {
886 unsigned arena_ind;
887 ctl_arena_t *ctl_arena;
888
889 if ((ctl_arena = ql_last(&ctl_arenas->destroyed, destroyed_link)) !=
890 NULL) {
891 ql_remove(&ctl_arenas->destroyed, ctl_arena, destroyed_link);
892 arena_ind = ctl_arena->arena_ind;
893 } else {
894 arena_ind = ctl_arenas->narenas;
895 }
896
897 /* Trigger stats allocation. */
898 if (arenas_i_impl(tsd, arena_ind, false, true) == NULL) {
899 return UINT_MAX;
900 }
901
902 /* Initialize new arena. */
903 if (arena_init(tsd_tsdn(tsd), arena_ind, extent_hooks) == NULL) {
904 return UINT_MAX;
905 }
906
907 if (arena_ind == ctl_arenas->narenas) {
908 ctl_arenas->narenas++;
909 }
910
911 return arena_ind;
912}
913
914static void
915ctl_background_thread_stats_read(tsdn_t *tsdn) {

Callers 1

arenas_create_ctlFunction · 0.85

Calls 3

arenas_i_implFunction · 0.85
arena_initFunction · 0.85
tsd_tsdnFunction · 0.85

Tested by

no test coverage detected