summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-07 23:40:13 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-07 23:40:13 +0100
commit519901db42f8a99e7605d48fbae59df6bc4ee2fe (patch)
tree4ac315d2aa9f2b088d84ed3344b8ce9a7ad0738a
parentm (diff)
downloadget-luminosity-519901db42f8a99e7605d48fbae59df6bc4ee2fe.tar.gz
get-luminosity-519901db42f8a99e7605d48fbae59df6bc4ee2fe.tar.bz2
get-luminosity-519901db42f8a99e7605d48fbae59df6bc4ee2fe.tar.xz
use posix_fadvise
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/framebuffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/framebuffer.c b/src/framebuffer.c
index 6a6d76a..05ada4a 100644
--- a/src/framebuffer.c
+++ b/src/framebuffer.c
@@ -51,6 +51,8 @@ int main()
height = var_info.yres;
inv_width = 1 / (double)width;
+ posix_fadvise(fd, 0, (size_t)(width * height * 4),
+ POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE | POSIX_FADV_WILLNEED);
mem = mmap(NULL, (size_t)(width * height * 4), PROT_READ, MAP_SHARED, fd, (off_t)0);
if (mem == MAP_FAILED)
return perror("get-luminosity::framebuffer: mmap"), close(fd), 1;