| 79 | } |
| 80 | |
| 81 | static inline bool |
| 82 | set_current_thread_affinity(int cpu) { |
| 83 | #if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY) |
| 84 | cpu_set_t cpuset; |
| 85 | CPU_ZERO(&cpuset); |
| 86 | CPU_SET(cpu, &cpuset); |
| 87 | int ret = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); |
| 88 | |
| 89 | return (ret != 0); |
| 90 | #else |
| 91 | return false; |
| 92 | #endif |
| 93 | } |
| 94 | |
| 95 | /* Threshold for determining when to wake up the background thread. */ |
| 96 | #define BACKGROUND_THREAD_NPAGES_THRESHOLD UINT64_C(1024) |
no outgoing calls
no test coverage detected