Page MenuHomePhabricator

Use getpagesize() instead of PAGE_SIZE macro when KMP_OS_LINUX is true
ClosedPublic

Authored by vhscampos on Oct 26 2016, 11:13 AM.

Details

Summary

Following the TODO comment in kmp_alloc.cpp line 1723, I replaced the usage of said macro (in kmp_runtime.c) by a call to getpagesize() when KMP_OS_LINUX is true.

Diff Detail

Event Timeline

vhscampos updated this revision to Diff 75918.Oct 26 2016, 11:13 AM
vhscampos retitled this revision from to Use getpagesize() instead of PAGE_SIZE macro when KMP_OS_LINUX is true.
vhscampos updated this object.
vhscampos added reviewers: jcownie, jlpeyton.
vhscampos added a subscriber: openmp-commits.
jlpeyton edited edge metadata.Oct 26 2016, 11:48 AM

Inside kmp_os.h (around the PAGE_SIZE code), could you have:

#if KMP_OS_LINUX
# define KMP_GET_PAGE_SIZE() getpagesize()
#else
# define KMP_GET_PAGE_SIZE() PAGE_SIZE
#endif

And then const int page_size = KMP_GET_PAGE_SIZE() inside kmp_alloc.c and kmp_runtime.c

vhscampos updated this revision to Diff 75926.Oct 26 2016, 12:09 PM
vhscampos edited edge metadata.

I have applied the suggestions.

jlpeyton accepted this revision.Oct 26 2016, 12:19 PM
jlpeyton edited edge metadata.

LGTM and thanks for the patch! Do I need to commit on your behalf?

This revision is now accepted and ready to land.Oct 26 2016, 12:19 PM
This revision was automatically updated to reflect the committed changes.