Skip to content

Commit 30f73aa

Browse files
authored
zend: optimisation for zend_get_page_size for macos. (#19494)
Using the getpagesize() call instead which saves one call.
1 parent 9b27fdb commit 30f73aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,9 +1275,10 @@ ZEND_API size_t zend_get_page_size(void)
12751275
SYSTEM_INFO system_info;
12761276
GetSystemInfo(&system_info);
12771277
return system_info.dwPageSize;
1278-
#elif defined(__FreeBSD__)
1278+
#elif defined(__FreeBSD__) || defined(__APPLE__)
12791279
/* This returns the value obtained from
1280-
* the auxv vector, avoiding a syscall. */
1280+
* the auxv vector, avoiding a
1281+
* syscall (on FreeBSD)/function call (on macOS). */
12811282
return getpagesize();
12821283
#else
12831284
return (size_t) sysconf(_SC_PAGESIZE);

0 commit comments

Comments
 (0)