Lines Matching full:length
20 #define LENGTH (256UL*1024*1024) macro
37 static void write_bytes(char *addr, size_t length) in write_bytes() argument
41 for (i = 0; i < length; i++) in write_bytes()
45 static int read_bytes(char *addr, size_t length) in read_bytes() argument
50 for (i = 0; i < length; i++) in read_bytes()
63 size_t length = LENGTH; in main() local
68 /* munmap with fail if the length is not page aligned */ in main()
69 if (hugepage_size > length) in main()
70 length = hugepage_size; in main()
73 length = atol(argv[1]) << 20; in main()
84 printf("Mapping %lu Mbytes\n", (unsigned long)length >> 20); in main()
86 addr = mmap(ADDR, length, PROTECTION, flags, -1, 0); in main()
94 write_bytes(addr, length); in main()
95 ret = read_bytes(addr, length); in main()
97 /* munmap() length of MAP_HUGETLB memory must be hugepage aligned */ in main()
98 if (munmap(addr, length)) { in main()