mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
jemalloc: use auxv ELF_BSDF_VMNOOVERCOMMIT instead of sysctl("vm.overcommit")
Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36540
This commit is contained in:
parent
62b4fb22df
commit
0ae364adcd
|
@ -11,6 +11,7 @@
|
|||
#ifdef JEMALLOC_SYSCTL_VM_OVERCOMMIT
|
||||
#include <sys/sysctl.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/auxv.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <vm/vm.h>
|
||||
#endif
|
||||
|
@ -441,6 +442,13 @@ os_overcommits_sysctl(void) {
|
|||
int vm_overcommit;
|
||||
size_t sz;
|
||||
|
||||
#ifdef ELF_BSDF_VMNOOVERCOMMIT
|
||||
int bsdflags;
|
||||
|
||||
if (_elf_aux_info(AT_BSDFLAGS, &bsdflags, sizeof(bsdflags)) == 0)
|
||||
return ((bsdflags & ELF_BSDF_VMNOOVERCOMMIT) == 0);
|
||||
#endif
|
||||
|
||||
sz = sizeof(vm_overcommit);
|
||||
#if defined(__FreeBSD__) && defined(VM_OVERCOMMIT)
|
||||
int mib[2];
|
||||
|
|
Loading…
Reference in a new issue