implement malloc_getcpu for windows
This commit is contained in:
parent
4e920d2c9d
commit
daa0e436ba
@ -10,7 +10,9 @@
|
|||||||
JEMALLOC_ALWAYS_INLINE malloc_cpuid_t
|
JEMALLOC_ALWAYS_INLINE malloc_cpuid_t
|
||||||
malloc_getcpu(void) {
|
malloc_getcpu(void) {
|
||||||
assert(have_percpu_arena);
|
assert(have_percpu_arena);
|
||||||
#if defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
#if defined(_WIN32)
|
||||||
|
return GetCurrentProcessorNumber();
|
||||||
|
#elif defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
||||||
return (malloc_cpuid_t)sched_getcpu();
|
return (malloc_cpuid_t)sched_getcpu();
|
||||||
#else
|
#else
|
||||||
not_reached();
|
not_reached();
|
||||||
|
@ -161,7 +161,7 @@ static const bool config_log =
|
|||||||
false
|
false
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
#ifdef JEMALLOC_HAVE_SCHED_GETCPU
|
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU)
|
||||||
/* Currently percpu_arena depends on sched_getcpu. */
|
/* Currently percpu_arena depends on sched_getcpu. */
|
||||||
#define JEMALLOC_PERCPU_ARENA
|
#define JEMALLOC_PERCPU_ARENA
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user