Commit 6061b90
authored
[compiler-rt] [test] refine target_page_size() in lit.common.cfg.py (NFC) (#170475)
Use mmap.PAGESIZE and fallback to os.sysconf if it is not available.
This allows to query the page size on Windows too, which has mmap but
not sysconf.
This is a pedantic change because Windows has a fixed page size of 4KiB.
I found this solution independently of #168857, and thought it might be
worth committing, since this is technically more correct.
[mmap.PAGESIZE implementation in
CPython](https://github.com/python/cpython/blob/88cd5d9850d2dc51abe43eb84198904d9870c26e/Modules/mmapmodule.c#L47)1 parent 60bb450 commit 6061b90
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
| 972 | + | |
971 | 973 | | |
972 | | - | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
973 | 982 | | |
974 | 983 | | |
975 | 984 | | |
| |||
0 commit comments