Lines Matching refs:pagesize
362 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE)); in RunSingleBufferOverreadTest() local
364 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory), pagesize, in RunSingleBufferOverreadTest()
365 2*pagesize) == 0); in RunSingleBufferOverreadTest()
366 memset(memory, 0x23, 2*pagesize); in RunSingleBufferOverreadTest()
369 ASSERT_TRUE(MprotectHeap(&memory[pagesize], pagesize, PROT_NONE) == 0); in RunSingleBufferOverreadTest()
371 for (size_t i = 0; i < pagesize; i++) { in RunSingleBufferOverreadTest()
372 uint8_t* buf = &memory[pagesize-i]; in RunSingleBufferOverreadTest()
376 ASSERT_TRUE(MprotectHeap(&memory[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0); in RunSingleBufferOverreadTest()
383 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE)); in RunSrcDstBufferOverreadTest() local
385 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory), pagesize, in RunSrcDstBufferOverreadTest()
386 2*pagesize) == 0); in RunSrcDstBufferOverreadTest()
387 memset(memory, 0x23, 2*pagesize); in RunSrcDstBufferOverreadTest()
390 ASSERT_TRUE(MprotectHeap(&memory[pagesize], pagesize, PROT_NONE) == 0); in RunSrcDstBufferOverreadTest()
392 uint8_t* dst_buffer = new uint8_t[2*pagesize]; in RunSrcDstBufferOverreadTest()
396 for (size_t j = 0; j < pagesize; j++) { in RunSrcDstBufferOverreadTest()
397 uint8_t* src = &memory[pagesize-j]; in RunSrcDstBufferOverreadTest()
402 ASSERT_TRUE(MprotectHeap(&memory[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0); in RunSrcDstBufferOverreadTest()
413 size_t pagesize = static_cast<size_t>(sysconf(_SC_PAGE_SIZE)); in RunCmpBufferOverreadTest() local
415 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory1), pagesize, in RunCmpBufferOverreadTest()
416 2*pagesize) == 0); in RunCmpBufferOverreadTest()
417 memset(memory1, 0x23, 2*pagesize); in RunCmpBufferOverreadTest()
420 ASSERT_TRUE(MprotectHeap(&memory1[pagesize], pagesize, PROT_NONE) == 0); in RunCmpBufferOverreadTest()
423 ASSERT_TRUE(posix_memalign(reinterpret_cast<void**>(&memory2), pagesize, in RunCmpBufferOverreadTest()
424 2*pagesize) == 0); in RunCmpBufferOverreadTest()
425 memset(memory2, 0x23, 2*pagesize); in RunCmpBufferOverreadTest()
428 ASSERT_TRUE(MprotectHeap(&memory2[pagesize], pagesize, PROT_NONE) == 0); in RunCmpBufferOverreadTest()
430 for (size_t i = 0; i < pagesize; i++) { in RunCmpBufferOverreadTest()
431 uint8_t* buf1 = &memory1[pagesize-i]; in RunCmpBufferOverreadTest()
432 uint8_t* buf2 = &memory2[pagesize-i]; in RunCmpBufferOverreadTest()
439 if (pagesize > MISCMP_MAX_LENGTH) { in RunCmpBufferOverreadTest()
442 miscmp_len = pagesize; in RunCmpBufferOverreadTest()
445 uint8_t* buf1 = &memory1[pagesize-i]; in RunCmpBufferOverreadTest()
450 uint8_t* buf2 = &memory2[pagesize-j]; in RunCmpBufferOverreadTest()
456 ASSERT_TRUE(MprotectHeap(&memory1[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0); in RunCmpBufferOverreadTest()
457 ASSERT_TRUE(MprotectHeap(&memory2[pagesize], pagesize, PROT_READ | PROT_WRITE) == 0); in RunCmpBufferOverreadTest()