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

Function prof_thread_name_alloc

deps/jemalloc/src/prof.c:2793–2814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2791}
2792
2793static char *
2794prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name) {
2795 char *ret;
2796 size_t size;
2797
2798 if (thread_name == NULL) {
2799 return NULL;
2800 }
2801
2802 size = strlen(thread_name) + 1;
2803 if (size == 1) {
2804 return "";
2805 }
2806
2807 ret = iallocztm(tsdn, size, sz_size2index(size), false, NULL, true,
2808 arena_get(TSDN_NULL, 0, true), true);
2809 if (ret == NULL) {
2810 return NULL;
2811 }
2812 memcpy(ret, thread_name, size);
2813 return ret;
2814}
2815
2816int
2817prof_thread_name_set(tsd_t *tsd, const char *thread_name) {

Callers 2

prof_tdata_reinitFunction · 0.70
prof_thread_name_setFunction · 0.70

Calls 3

iallocztmFunction · 0.50
sz_size2indexFunction · 0.50
arena_getFunction · 0.50

Tested by

no test coverage detected