mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
Allow 8k and 32k page sizes
Allow 8k and 32k page sizes in memalign and other memory related tests. This fixes crashes in the tests on systems with 8k or 32k pagesize. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15815
This commit is contained in:
parent
bb54e66345
commit
e7e2cc219f
@ -10,7 +10,8 @@ int main ( void )
|
||||
int i;
|
||||
unsigned long pszB = sysconf(_SC_PAGE_SIZE);
|
||||
assert(sizeof(long) == sizeof(void*));
|
||||
assert(pszB == 4096 || pszB == 16384 || pszB == 65536);
|
||||
assert(pszB == 4096 || pszB == 8192 || pszB == 16384 || pszB == 32768
|
||||
|| pszB == 65536);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
a[i] = valloc(11111 * (i+1));
|
||||
|
||||
@ -21,7 +21,8 @@ static void* get_unmapped_page(void)
|
||||
void* ptr;
|
||||
int r;
|
||||
long pagesz = sysconf(_SC_PAGE_SIZE);
|
||||
assert(pagesz == 4096 || pagesz == 16384 || pagesz == 65536);
|
||||
assert(pagesz == 4096 || pagesz == 8192 || pagesz == 16384 || pagesz == 32768
|
||||
|| pagesz == 65536);
|
||||
ptr = mmap(0, pagesz, PROT_READ, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
assert(ptr != (void*)-1);
|
||||
r = munmap(ptr, pagesz);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user