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

Function tsd_cleanup_wrapper

deps/jemalloc/include/jemalloc/internal/tsd_win.h:16–36  ·  view source on GitHub ↗

Initialization/cleanup. */

Source from the content-addressed store, hash-verified

14
15/* Initialization/cleanup. */
16JEMALLOC_ALWAYS_INLINE bool
17tsd_cleanup_wrapper(void) {
18 DWORD error = GetLastError();
19 tsd_wrapper_t *wrapper = (tsd_wrapper_t *)TlsGetValue(tsd_tsd);
20 SetLastError(error);
21
22 if (wrapper == NULL) {
23 return false;
24 }
25
26 if (wrapper->initialized) {
27 wrapper->initialized = false;
28 tsd_cleanup(&wrapper->val);
29 if (wrapper->initialized) {
30 /* Trigger another cleanup round. */
31 return true;
32 }
33 }
34 malloc_tsd_dalloc(wrapper);
35 return false;
36}
37
38JEMALLOC_ALWAYS_INLINE void
39tsd_wrapper_set(tsd_wrapper_t *wrapper) {

Callers

nothing calls this directly

Calls 2

tsd_cleanupFunction · 0.50
malloc_tsd_dallocFunction · 0.50

Tested by

no test coverage detected