[vorbis-dev] ogg123: shared memory by mmap()

Kenneth Arnold ken at arnoldnet.net
Sat Mar 17 11:08:40 PST 2001


On Sat, Mar 17, 2001 at 05:01:34PM +0000, Christian Weisgerber wrote:
> The patch below adds:
> 
> - acinclude.m4:  A new macro A_FUNC_SMMAP to check that sharing pages
>   through mmap() works.  This is taken from Joerg Schilling's star.

Have you checked license on that? A few of Joerg Schilling's programs
are not-entirely-free, but perhaps I'm just worrying too much (;

> - configure.in:  A_FUNC_SMMAP
> - ogg123/buffer.c:  If we have a working mmap(), use it to create
>   a region of shared memory instead of using System V IPC.
> 
> Works on BSD.  Should also work on SVR4 and offspring (Solaris),
> and Linux.

I can only test this on Linux, and since it does make some significant
changes in the build system (autoconf... if it ain't broke don't fix
it?), I'll commit after a few more CPUs have had a whack at it. Reply
personally with confirmations, to list with problems.

> -#ifndef DARWIN
> -#include <malloc.h>
> -#endif

Huh?

> +  if ((buf = (buf_t *) mmap (0, sizeof(buf_t) + sizeof (chunk_t) * (size - 1),
> +                             PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) < 0)

Just to note, a gcc-ism in buffer.h (the definition of chunk_t) would
have made that a bit cleaner and more intuitive.

Everything else looks okay; will test after I try out DRI again
(radeon 3d accel).


-- 
Kenneth Arnold <ken at arnoldnet.net> / kcarnold / Linux user #180115
http://arnoldnet.net/~kcarnold/



<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20010317/0f3c769b/part.obj


More information about the Vorbis-dev mailing list