[FFmpeg-devel] [PATCH] define _DARWIN_C_SOURCE for MAP_ANON

Måns Rullgård mans
Wed Jul 21 21:12:44 CEST 2010


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> On Wed, Jul 21, 2010 at 02:47:00PM -0300, Ramiro Polla wrote:
>> 2010/7/21 M?ns Rullg?rd <mans at mansr.com>:
>> > Ramiro Polla <ramiro.polla at gmail.com> writes:
>> >> 2010/7/21 M?ns Rullg?rd <mans at mansr.com>:
>> >>> BTW, the dyncode thing is missing a cache sync operation.
>> >>
>> >> Could you please elaborate on this?
>> >
>> > After writing the code, the D-cache must be flushed and the I-cache
>> > invalidated. ?There is usually no automatic coherency between them.
>> 
>> Something like in attached patch? (not thoroughly tested, I'd just
>> like to know if this is the right way to go). Is something equivalent
>> needed for linux or will mprotect do it automatically?
>
> Seems much simpler for me to use a MFENCE and a loop with CLFLUSH.
> Of course I don't know if CLFLUSH might not be available on some MMX-capable
> CPUs, but it seems hard to imagine.

Linux has a special syscall to do whatever is required, and gcc has a
__builtin_clear_cache() to call it or do something else with the right
effect.  I don't know what it does on osx or windows.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list