diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 12:05:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-06 12:05:02 +0200 |
commit | 92424a45d0c3154ad83aaba6e0fb8dbb17d8d1a4 (patch) | |
tree | 57bfa4eb5592ef1950b1fd733de4c8ee4c02c15a /libavutil/mem.h | |
parent | bcd1c2061211c7a4126db241229c5ecb71e05f80 (diff) | |
parent | b634b36fcebfe16b837b6c4044f5d5cb99a75040 (diff) | |
download | ffmpeg-92424a45d0c3154ad83aaba6e0fb8dbb17d8d1a4.tar.gz |
Merge commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040'
* commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040':
mem: Improve documentation wording and spelling
Conflicts:
libavutil/mem.c
libavutil/mem.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r-- | libavutil/mem.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h index 08dc49fd42..37c1ec3b5e 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -83,8 +83,7 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); /** - * Helper function to allocate a block of size * nmemb bytes with - * using av_malloc() + * Allocate a block of size * nmemb bytes with av_malloc(). * @param nmemb Number of elements * @param size Size of the single element * @return Pointer to the allocated block, NULL if the block cannot @@ -102,14 +101,14 @@ av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t siz * Allocate or reallocate a block of memory. * If ptr is NULL and size > 0, allocate a new block. If * size is zero, free the memory block pointed to by ptr. - * @note Pointers provided by av_malloc family of functions cannot be - * passed to av_realloc(). * @param ptr Pointer to a memory block already allocated with * av_realloc() or NULL. - * @param size Size in bytes for the memory block to be allocated or + * @param size Size in bytes of the memory block to be allocated or * reallocated. - * @return Pointer to a newly reallocated block or NULL if the block + * @return Pointer to a newly-reallocated block or NULL if the block * cannot be reallocated or the function is used to free the memory block. + * @note av_realloc() is not guaranteed to maintain the alignment of + * pointers originating from the av_malloc() family of functions. * @see av_fast_realloc() */ void *av_realloc(void *ptr, size_t size) av_alloc_size(2); @@ -128,29 +127,29 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize); * Allocate or reallocate an array. * If ptr is NULL and nmemb > 0, allocate a new block. If * nmemb is zero, free the memory block pointed to by ptr. - * @note Pointers provided by av_malloc family of functions cannot be - * passed to av_realloc_array(). * @param ptr Pointer to a memory block already allocated with * av_realloc() or NULL. * @param nmemb Number of elements * @param size Size of the single element - * @return Pointer to a newly reallocated block or NULL if the block + * @return Pointer to a newly-reallocated block or NULL if the block * cannot be reallocated or the function is used to free the memory block. + * @note av_realloc_array() is not guaranteed to maintain the alignment of + * pointers originating from the av_malloc() family of functions. */ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size); /** - * Allocate or reallocate an array. + * Allocate or reallocate an array through a pointer to a pointer. * If *ptr is NULL and nmemb > 0, allocate a new block. If * nmemb is zero, free the memory block pointed to by ptr. - * @note Pointers provided by av_malloc family of functions cannot be - * passed to av_reallocp_array(). * @param ptr Pointer to a pointer to a memory block already allocated * with av_realloc(), or pointer to a pointer to NULL. * The pointer is updated on success, or freed on failure. * @param nmemb Number of elements * @param size Size of the single element * @return Zero on success, an AVERROR error code on failure. + * @note av_reallocp_array() is not guaranteed to maintain the alignment of + * pointers originating from the av_malloc() family of functions. */ av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); @@ -187,8 +186,7 @@ void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib; /** - * Helper function to allocate a block of size * nmemb bytes with - * using av_mallocz() + * Allocate a block of size * nmemb bytes with av_mallocz(). * @param nmemb Number of elements * @param size Size of the single element * @return Pointer to the allocated block, NULL if the block cannot @@ -206,7 +204,7 @@ av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t si /** * Duplicate the string s. * @param s string to be duplicated - * @return Pointer to a newly allocated string containing a + * @return Pointer to a newly-allocated string containing a * copy of s or NULL if the string cannot be allocated. */ char *av_strdup(const char *s) av_malloc_attrib; @@ -296,7 +294,7 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r) void av_max_alloc(size_t max); /** - * @brief deliberately overlapping memcpy implementation + * deliberately overlapping memcpy implementation * @param dst destination buffer * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 * @param cnt number of bytes to copy, must be >= 0 |