cool-fountain-95457
08/11/2026, 11:59 AMc
len = buf_size * nr_bufs;
if (use_huge) {
cbr->buf = mmap(NULL, len, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_HUGETLB|MAP_HUGE_2MB|MAP_ANONYMOUS,
-1, 0);
if (cbr->buf == MAP_FAILED) {
perror("mmap");
return 1;
}
} else {
if (posix_memalign(&cbr->buf, page_size, len)) {
perror("posix memalign");
return 1;
}
}
i was wondering if a loop(nr_bufs) + malloc is that different