mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
mach: Use PAGE_SIZE
The PAGE_SIZE from the Mach headers statically defines the machine's page size. There's no need to query it dynamically; furthermore, the implementation of the vm_statistics () RPC unconditionally fills in pagesize = PAGE_SIZE; Not doing the extra RPC shaves off 2 RPCs from the start-up of every process! Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230218203717.373211-7-bugaevc@gmail.com>
This commit is contained in:
parent
90ab316b02
commit
be318c0f38
@ -17,6 +17,7 @@
|
||||
|
||||
#include <mach.h>
|
||||
#include <mach/mig_support.h>
|
||||
#include <mach/vm_param.h>
|
||||
#include <unistd.h>
|
||||
|
||||
mach_port_t __mach_task_self_;
|
||||
@ -38,7 +39,10 @@ __mach_init (void)
|
||||
__mach_host_self_ = (__mach_host_self) ();
|
||||
__mig_init (0);
|
||||
|
||||
#ifdef HAVE_HOST_PAGE_SIZE
|
||||
#ifdef PAGE_SIZE
|
||||
__vm_page_size = PAGE_SIZE;
|
||||
(void) err;
|
||||
#elif defined (HAVE_HOST_PAGE_SIZE)
|
||||
if (err = __host_page_size (__mach_host_self (), &__vm_page_size))
|
||||
_exit (err);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user