| 2791 | } |
| 2792 | |
| 2793 | static char * |
| 2794 | prof_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 | |
| 2816 | int |
| 2817 | prof_thread_name_set(tsd_t *tsd, const char *thread_name) { |
no test coverage detected