dte test coverage


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 50.0% high: ≥ 85.0%
Coverage Exec / Excl / Total
Lines: 100.0% 3 / 0 / 3
Functions: 100.0% 1 / 0 / 1
Branches: -% 0 / 2 / 2

src/util/xadvise.c
Line Branch Exec Source
1 #include "build-defs.h"
2 #if HAVE_POSIX_MADVISE
3 #include <sys/mman.h>
4 #endif
5 #include "xadvise.h"
6 #include "debug.h"
7
8 1 int advise_sequential(void *addr, size_t len)
9 {
10 1 BUG_ON(len == 0);
11
12 #if HAVE_POSIX_MADVISE
13 1 return posix_madvise(addr, len, POSIX_MADV_SEQUENTIAL);
14 #else
15 (void)addr;
16 #endif
17
18 // "The posix_madvise() function shall have no effect on the semantics
19 // of access to memory in the specified range, although it may affect
20 // the performance of access". Ergo, doing nothing is a valid fallback.
21 return 0;
22 }
23