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

Function tsd_cleanup_wrapper

deps/jemalloc/include/jemalloc/internal/tsd_generic.h:31–51  ·  view source on GitHub ↗

Initialization/cleanup. */

Source from the content-addressed store, hash-verified

29
30/* Initialization/cleanup. */
31JEMALLOC_ALWAYS_INLINE void
32tsd_cleanup_wrapper(void *arg) {
33 tsd_wrapper_t *wrapper = (tsd_wrapper_t *)arg;
34
35 if (wrapper->initialized) {
36 wrapper->initialized = false;
37 tsd_cleanup(&wrapper->val);
38 if (wrapper->initialized) {
39 /* Trigger another cleanup round. */
40 if (pthread_setspecific(tsd_tsd, (void *)wrapper) != 0)
41 {
42 malloc_write("<jemalloc>: Error setting TSD\n");
43 if (opt_abort) {
44 abort();
45 }
46 }
47 return;
48 }
49 }
50 malloc_tsd_dalloc(wrapper);
51}
52
53JEMALLOC_ALWAYS_INLINE void
54tsd_wrapper_set(tsd_wrapper_t *wrapper) {

Callers

nothing calls this directly

Calls 3

tsd_cleanupFunction · 0.50
malloc_writeFunction · 0.50
malloc_tsd_dallocFunction · 0.50

Tested by

no test coverage detected