summaryrefslogtreecommitdiff
path: root/libavutil/mem.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-04 13:48:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-04 13:57:01 +0200
commit1c10e89c5155fbd13fbf3c0da890a373145f1c32 (patch)
tree04c43668beb8a397f8792e8a3932cbd7d24b0e74 /libavutil/mem.h
parent44d884f036fa8147e8a16d2753c379198a5d5a6b (diff)
parentb4ec7a5fee644ad9882e10c097817b65447b8e55 (diff)
downloadffmpeg-1c10e89c5155fbd13fbf3c0da890a373145f1c32.tar.gz
Merge commit 'b4ec7a5fee644ad9882e10c097817b65447b8e55'
* commit 'b4ec7a5fee644ad9882e10c097817b65447b8e55': mem: Document the av_realloc family of functions properly Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r--libavutil/mem.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h
index fb23a69094..08dc49fd42 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -102,8 +102,10 @@ 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_malloc(z)() or av_realloc() or NULL.
+ * av_realloc() or NULL.
* @param size Size in bytes for the memory block to be allocated or
* reallocated.
* @return Pointer to a newly reallocated block or NULL if the block
@@ -126,8 +128,10 @@ 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_malloc(z)() or av_realloc() or NULL.
+ * 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
@@ -139,8 +143,10 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
* 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_reallocp_array().
* @param ptr Pointer to a pointer to a memory block already allocated
- * with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL.
+ * 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