| 7 | #include "threadLocalData.h" |
| 8 | |
| 9 | static pthread_key_t init_profiler_data_key() { |
| 10 | pthread_key_t profiler_data_key; |
| 11 | |
| 12 | if (pthread_key_create(&profiler_data_key, free) != 0) { |
| 13 | return -1; |
| 14 | } |
| 15 | |
| 16 | return profiler_data_key; |
| 17 | } |
| 18 | |
| 19 | // A key that points to a malloc'd asprof_thread_local_data |
| 20 | pthread_key_t ThreadLocalData::_profiler_data_key = init_profiler_data_key(); |