Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9997a812
Commit
9997a812
authored
Sep 13, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mem: Document the non-compatibility of av_realloc() and av_malloc()
parent
aca25104
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
mem.h
libavutil/mem.h
+18
-6
No files found.
libavutil/mem.h
View file @
9997a812
...
...
@@ -106,8 +106,12 @@ av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t siz
* reallocated.
* @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.
* @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.
* @see av_fast_realloc()
*/
void
*
av_realloc
(
void
*
ptr
,
size_t
size
)
av_alloc_size
(
2
);
...
...
@@ -122,8 +126,12 @@ void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
* @param size Size of the single element
* @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.
* @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.
*/
av_alloc_size
(
2
,
3
)
void
*
av_realloc_array
(
void
*
ptr
,
size_t
nmemb
,
size_t
size
);
...
...
@@ -137,8 +145,12 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
* @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.
* @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.
*/
av_alloc_size
(
2
,
3
)
int
av_reallocp_array
(
void
*
ptr
,
size_t
nmemb
,
size_t
size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment