diff options
author | mycroft <mycroft> | 2001-05-12 20:21:36 +0000 |
---|---|---|
committer | mycroft <mycroft> | 2001-05-12 20:21:36 +0000 |
commit | ad8014cc97966f4d9f26fe963aed99c15e5f2cd9 (patch) | |
tree | 4a57619bbdb0ccbc28b3af9123f81402e05b29d8 /audio | |
parent | de018188d8803ccad87700e8077f74e9935ca6c6 (diff) | |
download | pkgsrc-ad8014cc97966f4d9f26fe963aed99c15e5f2cd9.tar.gz |
After playing a file using mmap(2), do a MADV_FREE. In theory this will help
prevent other bits getting paged out.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/mpg123/distinfo | 4 | ||||
-rw-r--r-- | audio/mpg123/patches/patch-al | 32 |
2 files changed, 25 insertions, 11 deletions
diff --git a/audio/mpg123/distinfo b/audio/mpg123/distinfo index 80aa3c2cc6d..43ebbc1e12a 100644 --- a/audio/mpg123/distinfo +++ b/audio/mpg123/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2001/04/18 12:14:35 agc Exp $ +$NetBSD: distinfo,v 1.3 2001/05/12 20:21:36 mycroft Exp $ SHA1 (mpg123/mpg123-0.59r.tar.gz) = c32fe242f4506d218bd19a51a4034da9fdc79493 Size (mpg123/mpg123-0.59r.tar.gz) = 159028 bytes @@ -17,4 +17,4 @@ SHA1 (patch-ah) = e1419bc6d25360d0825041028b6b3f485bcf5f43 SHA1 (patch-ai) = da0d329fd6cd039db27cffcc1063144e1e56943f SHA1 (patch-aj) = 910b2834c34e617c492a3c72e4d2185d3eb53ecc SHA1 (patch-ak) = b30898cff26859eca0d23ea8cfdd461920b978a8 -SHA1 (patch-al) = 24369dcd33c8f86be8930b0898b36135ca9a0186 +SHA1 (patch-al) = 88dec640d40e6a3f1828096a4ff7b5a4dbd0a222 diff --git a/audio/mpg123/patches/patch-al b/audio/mpg123/patches/patch-al index 2af31da2dcb..37f3ba7781a 100644 --- a/audio/mpg123/patches/patch-al +++ b/audio/mpg123/patches/patch-al @@ -1,7 +1,7 @@ -$NetBSD: patch-al,v 1.2 2000/03/01 22:26:19 pooka Exp $ +$NetBSD: patch-al,v 1.3 2001/05/12 20:21:37 mycroft Exp $ ---- readers.c.orig Thu Mar 4 13:03:49 1999 -+++ readers.c Thu Mar 2 00:21:17 2000 +--- readers.c.orig Thu Mar 4 11:03:49 1999 ++++ readers.c Sat May 12 20:09:05 2001 @@ -1,5 +1,9 @@ #include <stdlib.h> @@ -12,15 +12,29 @@ $NetBSD: patch-al,v 1.2 2000/03/01 22:26:19 pooka Exp $ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -@@ -249,6 +253,11 @@ - mmap(NULL, len, PROT_READ, MAP_SHARED , rds->filept, 0); - if(!mapbuf || mapbuf == MAP_FAILED) +@@ -251,7 +255,12 @@ return -1; + + mapend = mapbuf + len; +- + +#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000) -+ if(madvise(mappnt, len, MADV_SEQUENTIAL) < 0) ++ if(madvise(mapbuf, mapend-mapbuf, MADV_SEQUENTIAL) < 0) + fprintf(stderr,"madvise failed, continuing anyways..\n"); +#endif ++ + if(param.verbose > 1) + fprintf(stderr,"Using memory mapped IO for this stream.\n"); - mapend = mapbuf + len; - +@@ -268,6 +276,11 @@ + + static void mapped_close(struct reader *rds) + { ++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000) ++ if(madvise(mapbuf, mapend-mapbuf, MADV_FREE) < 0) ++ fprintf(stderr,"madvise failed, continuing anyways..\n"); ++#endif ++ + munmap((void *)mapbuf,mapend-mapbuf); + if (rds->flags & READER_FD_OPENED) + close(rds->filept); |