[Ffmpeg-devel] Proposal: remove av_mallocz_static and friends

Michael Niedermayer michaelni
Wed Oct 11 22:06:07 CEST 2006


Hi

On Wed, Oct 11, 2006 at 03:49:36PM -0400, Rich Felker wrote:
> In the past we've had issues with people wanting to use libavcodec as
> a dynamically loaded module encountering trouble with the static table
> allocations, e.g. if multiple modules using libavcodec are loaded,
> it's unclear who is responsible for freeing this data and either
> memory leaks or corruption could result. I have a simple proposal for
> getting rid of this nasty global state issue: remove av_*alloc*_static
> API and just declare the space as arrays in the C source. As long as
> they're uninitialized they'll be put in the BSS segment and the pages
> won't use any memory until something actually writes to them. Of
> course they also use no space on disk.

hmm iam not so sure that they will be allocated on write everywhere,
especially some OS on small memory starved embeded devices might
not have the hardware or OS support for that ...

OTOH if every OS under which ffmpeg can run supports alloc on write
then ive no objections to this ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list