It may be dynamic so we can't rely on PAGE_SIZE being present or
correct.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
tests/sys/posixshm/posixshm_test.c | ||
---|---|---|
1127 | This one doesn't look correct for non-4k pages. |
tests/sys/posixshm/posixshm_test.c | ||
---|---|---|
1207–1208 | Why not use ps[0] here as is done elsewhere? |
tests/sys/posixshm/posixshm_test.c | ||
---|---|---|
1127 | Yeah, looks like it's supposed to be 1 << PAGE_SHIFT. |
Comment Actions
- Remove a call to getpagesize when we already have it's result in the ps array
- Use page_size as the offset in the Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) to OFF_MAX test
Comment Actions
One possible nit
tests/sys/posixshm/posixshm_test.c | ||
---|---|---|
1193 | This weakens the test. Shouldn't it be == page_size and make page_size a global? |
tests/sys/posixshm/posixshm_test.c | ||
---|---|---|
1193 | It's more of a sanity check than a test. |
Comment Actions
BTW, should PAGE_SIZE be the least guaranteed page size? In other words, should some test ensure _Static_assert(PAGE_SIZE <= ps[0]). Also perhaps something about ps[0] being multiple of PAGE_SIZE worth to be guaranteed?
Comment Actions
PAGE_SIZE is passed into mmap so would need to be the maximum value. I've created D34980 to add a test that the values we get from getpagesize and getpagesizes are what we expect.