Skip to content

Commit 1ea4995

Browse files
committed
using getpagesize instead
1 parent 2c08c57 commit 1ea4995

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Zend/zend.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
#include "php.h"
4343
#include "php_globals.h"
4444

45-
#if defined(__APPLE__)
46-
#include <mach/machine/vm_param.h>
47-
#endif
48-
4945
// FIXME: Breaks the declaration of the function below
5046
#undef zenderror
5147

@@ -1279,13 +1275,10 @@ ZEND_API size_t zend_get_page_size(void)
12791275
SYSTEM_INFO system_info;
12801276
GetSystemInfo(&system_info);
12811277
return system_info.dwPageSize;
1282-
#elif defined(__APPLE__)
1283-
/* Is in fact the global vm_page_size which is a kernel global
1284-
* we save a syscall as they fetch the same cached value */
1285-
return (size_t)PAGE_SIZE;
1286-
#elif defined(__FreeBSD__)
1278+
#elif defined(__FreeBSD__) || defined(__APPLE__)
12871279
/* This returns the value obtained from
1288-
* the auxv vector, avoiding a syscall. */
1280+
* the auxv vector, avoiding a
1281+
* syscall (on FreeBSD)/function call (on macOS). */
12891282
return getpagesize();
12901283
#else
12911284
return (size_t) sysconf(_SC_PAGESIZE);

0 commit comments

Comments
 (0)