[FFmpeg-user] Is av_malloc() and av_free() thread safe?

Unga unga888 at yahoo.com
Thu Sep 22 11:39:07 CEST 2011


--- On Thu, 9/22/11, Kirill Gavrilov <gavr.mail at gmail.com> wrote:

> From: Kirill Gavrilov <gavr.mail at gmail.com>
> Subject: Re: [FFmpeg-user] Is av_malloc() and av_free() thread safe?
> To: "FFmpeg user questions and RTFMs" <ffmpeg-user at ffmpeg.org>
> Date: Thursday, September 22, 2011, 12:20 PM
> On Wed, Sep 21, 2011 at 8:48 PM, Unga
> <unga888 at yahoo.com>
> wrote:
> >
> > Hi all
> >
> > Is av_malloc() and av_free() thread safe?
> >
> av_malloc() and av_free() just redirects to standard
> malloc() /
> posix_memalign() / free() functions.
> The main difference is that them ensure alignment for some
> instructions like
> SSE / MMX and so on available on your CPU and used in
> FFmpeg
> decoders/encoders.
> 
> No global storage and no any advanced memory management are
> implemented in
> FFmpeg.
> Thus yes - these FFmpeg functions should be thread-safe if
> memory allocator
> of your CRT library is thread-safe ;) (generally it is).
> -----------------------------------------------
> Kirill Gavrilov,
> Software designer.
> <kirill at sview.ru>

Hi Kirill

Thank you for the info. I'll take it as thread safe.

Best regards
Unga



More information about the ffmpeg-user mailing list