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

Michael Niedermayer michaelni
Fri Nov 2 15:55:25 CET 2007


On Thu, Nov 01, 2007 at 09:25:11PM +0100, Stefano Sabatini wrote:
> 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.

looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071102/c81152af/attachment.pgp>



More information about the ffmpeg-devel mailing list