Commit 748b303e authored by Derk-Jan Hartman's avatar Derk-Jan Hartman Committed by Jean-Baptiste Kempf

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

(cherry picked from commit 7ac6c947)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent bbbb663b
...@@ -119,6 +119,13 @@ static int Open (vlc_object_t *p_this) ...@@ -119,6 +119,13 @@ static int Open (vlc_object_t *p_this)
goto error; 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 */ /* Autodetect mmap() support */
if (st.st_size > 0) 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