Commit cbc1122a authored by hartman's avatar hartman
Browse files

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.
parent 4a202532
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment