fix build for non linux/BSD platforms.
This commit is contained in:
parent
3de0c24859
commit
4c95c953e2
@ -2024,6 +2024,15 @@ if test "x$have_sched_setaffinity" = "x1" ; then
|
|||||||
AC_DEFINE([JEMALLOC_HAVE_SCHED_SETAFFINITY], [ ], [ ])
|
AC_DEFINE([JEMALLOC_HAVE_SCHED_SETAFFINITY], [ ], [ ])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl Check if the pthread_setaffinity_np function exists.
|
||||||
|
AC_CHECK_FUNC([pthread_setaffinity_np],
|
||||||
|
[have_pthread_setaffinity_np="1"],
|
||||||
|
[have_pthread_setaffinity_np="0"]
|
||||||
|
)
|
||||||
|
if test "x$have_pthread_setaffinity_np" = "x1" ; then
|
||||||
|
AC_DEFINE([JEMALLOC_HAVE_PTHREAD_SETAFFINITY_NP], [ ], [ ])
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Check if the Solaris/BSD issetugid function exists.
|
dnl Check if the Solaris/BSD issetugid function exists.
|
||||||
AC_CHECK_FUNC([issetugid],
|
AC_CHECK_FUNC([issetugid],
|
||||||
[have_issetugid="1"],
|
[have_issetugid="1"],
|
||||||
|
@ -391,6 +391,9 @@
|
|||||||
/* GNU specific sched_setaffinity support */
|
/* GNU specific sched_setaffinity support */
|
||||||
#undef JEMALLOC_HAVE_SCHED_SETAFFINITY
|
#undef JEMALLOC_HAVE_SCHED_SETAFFINITY
|
||||||
|
|
||||||
|
/* pthread_setaffinity_np support */
|
||||||
|
#undef JEMALLOC_HAVE_PTHREAD_SETAFFINITY_NP
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If defined, all the features necessary for background threads are present.
|
* If defined, all the features necessary for background threads are present.
|
||||||
*/
|
*/
|
||||||
|
@ -113,9 +113,7 @@ background_thread_info_init(tsdn_t *tsdn, background_thread_info_t *info) {
|
|||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
set_current_thread_affinity(int cpu) {
|
set_current_thread_affinity(int cpu) {
|
||||||
#ifdef __OpenBSD__
|
#if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY) || defined(JEMALLOC_HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
#if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY)
|
#if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY)
|
||||||
cpu_set_t cpuset;
|
cpu_set_t cpuset;
|
||||||
#else
|
#else
|
||||||
@ -146,6 +144,8 @@ set_current_thread_affinity(int cpu) {
|
|||||||
# endif
|
# endif
|
||||||
return ret != 0;
|
return ret != 0;
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user