Skip to content

Conversation

twose
Copy link
Member

@twose twose commented May 27, 2021

The code is referenced from https://github.com/jemalloc/jemalloc/blob/master/src/pages.c#L417 .
A small change, just for code reuse.

GetSystemInfo(&system_info);
page_size = system_info.dwPageSize;
# else
page_size = getpagesize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're unconditionally using getpagesize() here. Why does the new code limit its use to only FreeBSD?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux manual recommends using sysconf(_SC_PAGESIZE) instead of getpagesize() for portability.
The code is referenced from https://github.com/jemalloc/jemalloc/blob/master/src/pages.c#L417
The comment shows the reason for it, it can avoid a useless syscall on FreeBSD.

@twose twose merged commit 795efd7 into php:master May 27, 2021
@twose twose deleted the fiber-getpagesize branch May 27, 2021 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants