[FFmpeg-cvslog] avutil/mem: remove av_realloc / av_malloc incompatibility warning

Michael Niedermayer git at videolan.org
Tue Aug 23 14:54:37 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr 21 15:12:36 2015 +0200| [21f70940ae106bfffa07e73057cdb4b5e81a767a] | committer: Michael Niedermayer

avutil/mem: remove av_realloc / av_malloc incompatibility warning

memalign() is not guranteed to be compatible with free() or realloc()
and for platforms in this category we have --enable-memalign-hack
(which should be enabled automatically if such system is detected)
Trying to somehow half support systems that can free() memalign memory
but not reallocate it seems not worth the amount of work needed to
keep 2 then incompatible allocation systems and ensure their
seperation. That is unless this would affect a major platform
on which we want to avoid the memalign hack code

The warnings also cause wasted time and effort as people try
to maintain a separation that does not exist currently.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21f70940ae106bfffa07e73057cdb4b5e81a767a
---

 libavutil/mem.h | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 7f0c610..f9d8884 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -252,12 +252,6 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
  * @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
  *
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
  * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be
  *          correctly aligned.
  * @see av_fast_realloc()
@@ -281,12 +275,6 @@ void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
  *
  * @return Zero on success, an AVERROR error code on failure
  *
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_reallocp(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  *          correctly aligned.
  */
@@ -324,12 +312,6 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
  * @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
  *
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  *          correctly aligned.
  * @see av_reallocp_array()
@@ -350,12 +332,6 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
  *
  * @return Zero on success, an AVERROR error code on failure
  *
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  *          correctly aligned.
  */



More information about the ffmpeg-cvslog mailing list