[FFmpeg-devel] [PATCH] Doxygenate libavutil/mem.h

Stefano Sabatini stefano.sabatini-lala
Thu Nov 1 21:25:11 CET 2007


On date Thursday 2007-11-01 17:46:58 +0100, Michael Niedermayer encoded:
> On Thu, Nov 01, 2007 at 03:31:40PM +0100, Stefano Sabatini wrote:
[...]
> > New try, some cosmetic changes of the previous version gone into
> > another patch, small rework of av_realloc docs.
> > 
> > Regards
> > -- 
> > Stefano Sabatini
> > Linux user number 337176 (see http://counter.li.org)
> 
> > Index: libavutil/mem.h
> > ===================================================================
> > --- libavutil/mem.h	(revision 10893)
> > +++ libavutil/mem.h	(working copy)
> > @@ -33,16 +33,24 @@
> >  #endif
> >  
> >  /**
> > - * Memory allocation of size bytes with alignment suitable for all
> > - * memory accesses (including vectors if available on the
> > - * CPU). av_malloc(0) must return a non-NULL pointer.
> > + * Allocate a block of \p size bytes with alignment suitable for all
> > + * memory accesses (including vectors if available on the CPU).
> > + * @param size Size of the block to be allocated.
> 
> size in bytes

Fixed here and everywhere.
 
> > + * @return Pointer to the allocated block, NULL if it cannot allocate
> > + * it.
> > + * @see av_mallocz()
> >   */
> >  void *av_malloc(unsigned int size);
> >  
> >  /**
> > - * av_realloc semantics (same as glibc): If ptr is NULL and size > 0,
> > - * identical to malloc(size). If size is zero, it is identical to
> > - * free(ptr) and NULL is returned.
> > + * Allocate or reallocate a block of memory.
> > + * If \p ptr is NULL and \p size > 0, allocate a new block. If \p
> > + * size is zero, free the memory block pointed by \p ptr.
> > + * @param size New size for the block to be allocated or reallocated.
> 
> > + * @param ptr Pointer to an already allocated memory block or NULL.
> 
> wrong av_realloc(malloc(5), 0) is not valid

Fixed, now it tells:
 * @param ptr Pointer to a memory block already allocated with
 * av_malloc(z)() or av_realloc() or NULL.

Thanks for your review, hope now it is more correct.

Best regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doxygenate-mem-h-09.patch
Type: text/x-diff
Size: 2767 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071101/276b319c/attachment.patch>



More information about the ffmpeg-devel mailing list