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
fc91eeab
Commit
fc91eeab
authored
Nov 18, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/mem: Add av_fast_mallocz()
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
518742bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
APIchanges
doc/APIchanges
+3
-0
mem.c
libavutil/mem.c
+4
-0
mem.h
libavutil/mem.h
+15
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
fc91eeab
...
...
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
API changes, most recent first:
2015-11-18 - lavu 55.7.100 - mem.h
Add av_fast_mallocz()
2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h
xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement,
it resets the packet in a more consistent way.
...
...
libavutil/mem.c
View file @
fc91eeab
...
...
@@ -501,3 +501,7 @@ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
ff_fast_malloc
(
ptr
,
size
,
min_size
,
0
);
}
void
av_fast_mallocz
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
)
{
ff_fast_malloc
(
ptr
,
size
,
min_size
,
1
);
}
libavutil/mem.h
View file @
fc91eeab
...
...
@@ -384,6 +384,21 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
*/
void
av_fast_malloc
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
);
/**
* Allocate a buffer, reusing the given one if large enough.
*
* All newly allocated space is initially cleared
* Contrary to av_fast_realloc the current buffer contents might not be
* preserved and on error the old buffer is freed, thus no special
* handling to avoid memleaks is necessary.
*
* @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
* @param size size of the buffer *ptr points to
* @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
* *size 0 if an error occurred.
*/
void
av_fast_mallocz
(
void
*
ptr
,
unsigned
int
*
size
,
size_t
min_size
);
/**
* @}
*/
...
...
libavutil/version.h
View file @
fc91eeab
...
...
@@ -56,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR
6
#define LIBAVUTIL_VERSION_MINOR
7
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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