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

Function tcaches_elm_remove

deps/jemalloc/src/tcache.c:688–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688static tcache_t *
689tcaches_elm_remove(tsd_t *tsd, tcaches_t *elm, bool allow_reinit) {
690 malloc_mutex_assert_owner(tsd_tsdn(tsd), &tcaches_mtx);
691
692 if (elm->tcache == NULL) {
693 return NULL;
694 }
695 tcache_t *tcache = elm->tcache;
696 if (allow_reinit) {
697 elm->tcache = TCACHES_ELM_NEED_REINIT;
698 } else {
699 elm->tcache = NULL;
700 }
701
702 if (tcache == TCACHES_ELM_NEED_REINIT) {
703 return NULL;
704 }
705 return tcache;
706}
707
708void
709tcaches_flush(tsd_t *tsd, unsigned ind) {

Callers 2

tcaches_flushFunction · 0.70
tcaches_destroyFunction · 0.70

Calls 2

tsd_tsdnFunction · 0.50

Tested by

no test coverage detected