[MPlayer-dev-eng] Re: amd64 -sws 0 fix (iow: playing with NX bit)

Aurelien Jacobs aurel at gnuage.org
Mon Jan 24 20:43:07 CET 2005

On Mon, 24 Jan 2005 15:53:06 +0100
Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:

> Hi,
> On Mon, Jan 24, 2005 at 03:39:44PM +0100, Aurelien Jacobs wrote:
> > On Mon, 24 Jan 2005 13:31:05 +0100
> > Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > > On Mon, Jan 24, 2005 at 03:07:06AM +0100, Aurelien Jacobs wrote:
> > > > On Fri, 21 Jan 2005 21:40:34 +0100
> > > > Alex Beregszaszi <alex at fsn.hu> wrote:
> > > How about just using anonymous mmap instead of malloc+mprotect?
> > > According to my understandig of its manpage it should work...
> > 
> > Right, it works. But I don't like this too much. It less readable and not
> > really simpler IMHO.
> With all that alignment? And you have to find out the page size etc. for
> the other variant...

Hum... did you had a look at my mmap patch ?
It also check PAGESIZE to ensure that only funnyCode and nothing more
Maybe it's not useful ? I don't know if mmap only alloc full pages or
if non used end of page can be malloced later ?
Moreover, we also can't assume that we have mmap so we need an
alternative way to do it. That's why I think it's not simpler.

> > Do you think this patch is really better or should I stick with my
> > memalign() version ?
> Btw. BSD does not have memalign, as well as other OS (look in config.h
> it just uses normal malloc then).

That's pretty ugly :-(
maybe we should use posix_memalign instead ?
Or we should provide an alternative implementation for memalign, but
that seem pretty hard (if we want to be able to free()).

Finally what do you think is the best solution ?


More information about the MPlayer-dev-eng mailing list