[Ffmpeg-devel] Question about libavutil

Alexander Strasser eclipse7
Thu Oct 27 12:53:52 CEST 2005


Hi,

Luca Abeni wrote:
> On Tue, 2005-10-25 at 10:09 +0200, Luca Abeni wrote:
> [...]
> > >   I think we have a problem if we don't move mem.c too,
> > > which contains implementation of basic mem routines.
> > You are right. Sorry, my fault.
> > I'll send a corrected patch as soon as possible, changing alloc.c in
> > memutil.c
> Ok, here is a new patch... Hopefully this time I did not forget
> anything.

  No, but a slight misunderstanding I am afraid. I meant we
just move the file mem.c (so we also can preserve history in cvs).
There is a conceptual/technical difference between mem.c and
memutil.c: the stuff in memutil.c and everywhere else in ffmpeg
will automatically use your allocator if you override/replace the
funcs in mem.c .

[...]
> #ifndef ALLOC_H
> #define ALLOC_H
> 
> /* memory */
> void *av_malloc(unsigned int size);
> void *av_mallocz(unsigned int size);
> void *av_realloc(void *ptr, unsigned int size);
> void av_free(void *ptr);
> char *av_strdup(const char *s);
> void av_freep(void *ptr);
> void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
> /* for static data only */
> /* call av_free_static to release all staticaly allocated tables */
> void av_free_static(void);
> void *av_mallocz_static(unsigned int size);
> void *av_realloc_static(void *ptr, unsigned int size);
> 
> #endif /* ALLOC_H */

  Include guard should also reflect the new filename.

  If you care: resubmit an updated patch, if not i will
do the changes myself before testing.

  Alex (beastd)





More information about the ffmpeg-devel mailing list