diff options
author | Jaremy Creechley <creechley@gmail.com> | 2021-11-16 11:30:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 20:30:07 +0100 |
commit | 92d6fb86c66ceda154972314ba695cea4aac9301 (patch) | |
tree | 9ecfc5922972e4818b35667e59e7c30e41c44f74 /tests | |
parent | 309ec7167e6ea17112901533539be0a1884c8b65 (diff) | |
download | Nim-92d6fb86c66ceda154972314ba695cea4aac9301.tar.gz |
Enable customizing PageShift to set PageSize for embedded targets (#19129)
* Enable customizing PageSize (via PageShift). This enables adjusting PageSize for embedded targets without abusing cpu16. * copy nimPageXYZ settings for mmpaptest * add docs for Nim manual * add docs for Nim manual * docs tweaks Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mmaptest.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/mmaptest.nim b/tests/mmaptest.nim index 7a93cdd45..33010606f 100644 --- a/tests/mmaptest.nim +++ b/tests/mmaptest.nim @@ -19,8 +19,11 @@ proc `+!!`(p: pointer, size: int): pointer {.inline.} = result = cast[pointer](cast[int](p) + size) const - PageShift = when defined(cpu16): 8 else: 12 # \ - # my tests showed no improvements for using larger page sizes. + PageShift = when defined(nimPage256) or defined(cpu16): 8 + elif defined(nimPage512): 9 + elif defined(nimPage1k): 10 + else: 12 # \ # my tests showed no improvements for using larger page sizes. + PageSize = 1 shl PageShift var p = osAllocPages(3 * PageSize) |