From cbc1122ac4551505181ea048ca14a5f87041090f Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Fri, 10 Oct 2008 14:02:59 +0200 Subject: [PATCH] mmap: open with MAP_NOCACHE This means that when the machine gets low on memory, this mmap'ed 4GB movie file is the first to be thrown out of the memory again. --- modules/access/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/access/mmap.c b/modules/access/mmap.c index b9eadcaa06..a5aefd451a 100644 --- a/modules/access/mmap.c +++ b/modules/access/mmap.c @@ -136,7 +136,7 @@ static int Open (vlc_object_t *p_this) /* Autodetect mmap() support */ if (st.st_size > 0) { - void *addr = mmap (NULL, 1, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + void *addr = mmap (NULL, 1, PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_NOCACHE, fd, 0); if (addr != MAP_FAILED) munmap (addr, 1); else -- 2.39.5