> From: "Paul F. Johnson" <[EMAIL PROTECTED]>
>
> > > Also, does anyone know where mmap() is? I can't find it in the current
> > > distribution?
> >
> > mmap is a Unix (Posix?) system call, for mapping a file into memory. If
> > mpg123 uses it, and RISC OS doesn't have something equivalent, porting
could
> > be tricky...
>
> It may not be that tricky - it would depend on how the file was aligned
> in memory, would it be word or byte (i.e. 4 or 8 bytes) aligned?

Probably more like several kilobytes, matching the local MMU page alignment.
Faking a more strict alignment isn't difficult, though - allocate a larger
buffer (data size + alignment - 1) and offset your data within it (base
address % alignment).

> RISC OS uses word alignment when we load a file into memory, though
> mapping a file into memory is something else!

Indeed, particularly if code used on memory-mapped files is also used on
normal memory-resident data... small files (modulo available swap) can of
course be fully loaded into memory, so they're no problem. For large files
you could well be stuck...

Whether any of this is a big problem really depends on where and why mmap()
is being used. Do you know enough about the source to work that out? The
only source release of mpg123 I have is the modified version used in LAME,
and it doesn't use mmap() at all...

-- Mat.


--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to