mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Change the argument of memory allocation functions from unsigned int to size_t
with the next major bump in libavutil. Originally committed as revision 25871 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5bdbf64cf3
commit
b47541c7a3
@ -61,7 +61,7 @@ void free(void *ptr);
|
|||||||
memory allocator. You do not need to suppress this file because the
|
memory allocator. You do not need to suppress this file because the
|
||||||
linker will do it automatically. */
|
linker will do it automatically. */
|
||||||
|
|
||||||
void *av_malloc(unsigned int size)
|
void *av_malloc(FF_INTERNAL_MEM_TYPE size)
|
||||||
{
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
#if CONFIG_MEMALIGN_HACK
|
#if CONFIG_MEMALIGN_HACK
|
||||||
@ -116,7 +116,7 @@ void *av_malloc(unsigned int size)
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *av_realloc(void *ptr, unsigned int size)
|
void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
|
||||||
{
|
{
|
||||||
#if CONFIG_MEMALIGN_HACK
|
#if CONFIG_MEMALIGN_HACK
|
||||||
int diff;
|
int diff;
|
||||||
@ -154,7 +154,7 @@ void av_freep(void *arg)
|
|||||||
*ptr = NULL;
|
*ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *av_mallocz(unsigned int size)
|
void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
|
||||||
{
|
{
|
||||||
void *ptr = av_malloc(size);
|
void *ptr = av_malloc(size);
|
||||||
if (ptr)
|
if (ptr)
|
||||||
|
@ -62,6 +62,12 @@
|
|||||||
#define av_alloc_size(n)
|
#define av_alloc_size(n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LIBAVUTIL_VERSION_MAJOR < 51
|
||||||
|
# define FF_INTERNAL_MEM_TYPE unsigned int
|
||||||
|
#else
|
||||||
|
# define FF_INTERNAL_MEM_TYPE size_t
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a block of size bytes with alignment suitable for all
|
* Allocate a block of size bytes with alignment suitable for all
|
||||||
* memory accesses (including vectors if available on the CPU).
|
* memory accesses (including vectors if available on the CPU).
|
||||||
@ -70,7 +76,7 @@
|
|||||||
* be allocated.
|
* be allocated.
|
||||||
* @see av_mallocz()
|
* @see av_mallocz()
|
||||||
*/
|
*/
|
||||||
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
void *av_malloc(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate or reallocate a block of memory.
|
* Allocate or reallocate a block of memory.
|
||||||
@ -84,7 +90,7 @@ void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
|||||||
* cannot be reallocated or the function is used to free the memory block.
|
* cannot be reallocated or the function is used to free the memory block.
|
||||||
* @see av_fast_realloc()
|
* @see av_fast_realloc()
|
||||||
*/
|
*/
|
||||||
void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
|
void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) av_alloc_size(2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free a memory block which has been allocated with av_malloc(z)() or
|
* Free a memory block which has been allocated with av_malloc(z)() or
|
||||||
@ -104,7 +110,7 @@ void av_free(void *ptr);
|
|||||||
* @return Pointer to the allocated block, NULL if it cannot be allocated.
|
* @return Pointer to the allocated block, NULL if it cannot be allocated.
|
||||||
* @see av_malloc()
|
* @see av_malloc()
|
||||||
*/
|
*/
|
||||||
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
void *av_mallocz(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate the string s.
|
* Duplicate the string s.
|
||||||
|
Loading…
Reference in New Issue
Block a user