Revision 8a2d973d
libavutil/mem.h | ||
---|---|---|
33 | 33 |
#endif |
34 | 34 |
|
35 | 35 |
/** |
36 |
* Memory allocation of size byte with alignment suitable for all |
|
36 |
* Memory allocation of size bytes with alignment suitable for all
|
|
37 | 37 |
* memory accesses (including vectors if available on the |
38 |
* CPU). av_malloc(0) must return a non NULL pointer.
|
|
38 |
* CPU). av_malloc(0) must return a non-NULL pointer.
|
|
39 | 39 |
*/ |
40 | 40 |
void *av_malloc(unsigned int size); |
41 | 41 |
|
42 | 42 |
/** |
43 |
* av_realloc semantics (same as glibc): if ptr is NULL and size > 0,
|
|
43 |
* av_realloc semantics (same as glibc): If ptr is NULL and size > 0,
|
|
44 | 44 |
* identical to malloc(size). If size is zero, it is identical to |
45 | 45 |
* free(ptr) and NULL is returned. |
46 | 46 |
*/ |
... | ... | |
48 | 48 |
|
49 | 49 |
/** |
50 | 50 |
* Free memory which has been allocated with av_malloc(z)() or av_realloc(). |
51 |
* NOTE: ptr = NULL is explicetly allowed
|
|
52 |
* Note2: it is recommended that you use av_freep() instead
|
|
51 |
* NOTE: ptr = NULL is explicitly allowed.
|
|
52 |
* Note2: It is recommended that you use av_freep() instead.
|
|
53 | 53 |
*/ |
54 | 54 |
void av_free(void *ptr); |
55 | 55 |
|
56 | 56 |
void *av_mallocz(unsigned int size); |
57 | 57 |
|
58 | 58 |
/** |
59 |
* Duplicates the string \p s.
|
|
59 |
* Duplicate the string \p s. |
|
60 | 60 |
* @param s String to be duplicated. |
61 | 61 |
* @return Pointer to a newly allocated string containing a |
62 |
* copy of \p s or NULL if it cannot allocate it.
|
|
62 |
* copy of \p s or NULL if it cannot be allocated.
|
|
63 | 63 |
*/ |
64 | 64 |
char *av_strdup(const char *s); |
65 | 65 |
|
66 | 66 |
/** |
67 |
* Frees memory and sets the pointer to NULL.
|
|
68 |
* @param ptr pointer to the pointer which should be freed |
|
67 |
* Free memory and set the pointer to NULL.
|
|
68 |
* @param ptr pointer to the pointer which should be freed.
|
|
69 | 69 |
*/ |
70 | 70 |
void av_freep(void *ptr); |
71 | 71 |
|
Also available in: Unified diff