Commit 7ac6c947 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

mmap: Use fnctl to set the READAHEAD flag when supported. This should speedup the mmap performance

parent 360eeee3
......@@ -119,6 +119,13 @@ static int Open (vlc_object_t *p_this)
goto error;
}
# if defined(HAVE_FCNTL_H) && defined(F_FDAHEAD) && defined(F_NOCACHE)
/* We'd rather use any available memory for reading ahead
* than for caching what we've already mmap'ed */
fcntl (fd, F_RDAHEAD, 1);
fcntl (fd, F_NOCACHE, 1);
# endif
/* Autodetect mmap() support */
if (st.st_size > 0)
{
......
Markdown is supported
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