Lines Matching defs:pagesize
354 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE));
356 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory), pagesize,
357 2*pagesize) == 0);
358 memset(memory, 0x23, 2*pagesize);
361 ASSERT_TRUE(mprotect(&memory[pagesize], pagesize, PROT_NONE) == 0);
363 for (size_t i = 0; i < pagesize; i++) {
364 uint8_t* buf = &memory[pagesize-i];
368 ASSERT_TRUE(mprotect(&memory[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0);
375 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE));
377 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory), pagesize,
378 2*pagesize) == 0);
379 memset(memory, 0x23, 2*pagesize);
382 ASSERT_TRUE(mprotect(&memory[pagesize], pagesize, PROT_NONE) == 0);
384 uint8_t* dst = new uint8_t[pagesize];
385 for (size_t i = 0; i < pagesize; i++) {
386 uint8_t* src = &memory[pagesize-i];
390 ASSERT_TRUE(mprotect(&memory[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0);
401 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE));
403 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory1), pagesize,
404 2*pagesize) == 0);
405 memset(memory1, 0x23, 2*pagesize);
408 ASSERT_TRUE(mprotect(&memory1[pagesize], pagesize, PROT_NONE) == 0);
411 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory2), pagesize,
412 2*pagesize) == 0);
413 memset(memory2, 0x23, 2*pagesize);
416 ASSERT_TRUE(mprotect(&memory2[pagesize], pagesize, PROT_NONE) == 0);
418 for (size_t i = 0; i < pagesize; i++) {
419 uint8_t* buf1 = &memory1[pagesize-i];
420 uint8_t* buf2 = &memory2[pagesize-i];
425 // Don't cycle through pagesize, MISCMP_MAX_LENGTH bytes should be good.
427 if (pagesize > MISCMP_MAX_LENGTH) {
430 miscmp_len = pagesize;
433 uint8_t* buf1 = &memory1[pagesize-i];
438 uint8_t* buf2 = &memory2[pagesize-j];
444 ASSERT_TRUE(mprotect(&memory1[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0);
445 ASSERT_TRUE(mprotect(&memory2[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0);