annotate mem.h @ 374:8805bba131a9 libavutil

Add attribute that forces alignment of stack to functions that need it. Necessary for systems that don't align by default to 16 bytes, required by some SSE instructions. Requires GCC >= 4.2. Based on patch by Ga¸«³l Chardon.
author ramiro
date Mon, 13 Aug 2007 15:28:29 +0000
parents c1d6b0378055
children 6224c028828a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
108
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
1 /*
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
3 *
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
4 * This file is part of FFmpeg.
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
5 *
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
108
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
8 * License as published by the Free Software Foundation; either
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
108
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
10 *
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
108
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
14 * Lesser General Public License for more details.
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
15 *
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 113
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
108
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
19 */
11be8e0d1344 Add official LGPL license headers to the files that were missing them.
diego
parents: 104
diff changeset
20
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
21 /**
286
c1d6b0378055 Move the memory related functions out of common.h into their own header file
takis
parents: 284
diff changeset
22 * @file mem.h
c1d6b0378055 Move the memory related functions out of common.h into their own header file
takis
parents: 284
diff changeset
23 * Memory handling functions.
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
24 */
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
25
286
c1d6b0378055 Move the memory related functions out of common.h into their own header file
takis
parents: 284
diff changeset
26 #ifndef AV_MEM_H
c1d6b0378055 Move the memory related functions out of common.h into their own header file
takis
parents: 284
diff changeset
27 #define AV_MEM_H
104
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
28
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
29 #ifdef __GNUC__
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
30 #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
31 #else
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
32 #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
33 #endif
5111e87117b7 Align the input buffer in ffplay, introduce a public macro for aligned declarations
lu_zero
parents: 100
diff changeset
34
278
ca3eb39d3aa2 Move unaltered av_malloc() comments to the header file.
takis
parents: 252
diff changeset
35 /**
ca3eb39d3aa2 Move unaltered av_malloc() comments to the header file.
takis
parents: 252
diff changeset
36 * Memory allocation of size byte with alignment suitable for all
ca3eb39d3aa2 Move unaltered av_malloc() comments to the header file.
takis
parents: 252
diff changeset
37 * memory accesses (including vectors if available on the
ca3eb39d3aa2 Move unaltered av_malloc() comments to the header file.
takis
parents: 252
diff changeset
38 * CPU). av_malloc(0) must return a non NULL pointer.
ca3eb39d3aa2 Move unaltered av_malloc() comments to the header file.
takis
parents: 252
diff changeset
39 */
82
8fb151c4d4c7 Move av_malloc(), av_realloc(), and av_free() from libavcodec to libavutil
lucabe
parents: 80
diff changeset
40 void *av_malloc(unsigned int size);
279
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
41
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
42 /**
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
43 * av_realloc semantics (same as glibc): if ptr is NULL and size > 0,
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
44 * identical to malloc(size). If size is zero, it is identical to
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
45 * free(ptr) and NULL is returned.
4964532166e6 Move unaltered av_realloc() comments to the header file.
takis
parents: 278
diff changeset
46 */
82
8fb151c4d4c7 Move av_malloc(), av_realloc(), and av_free() from libavcodec to libavutil
lucabe
parents: 80
diff changeset
47 void *av_realloc(void *ptr, unsigned int size);
280
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
48
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
49 /**
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
50 * Free memory which has been allocated with av_malloc(z)() or av_realloc().
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
51 * NOTE: ptr = NULL is explicetly allowed
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
52 * Note2: it is recommended that you use av_freep() instead
8c22d0665daa Move unaltered av_free() comments to the header file.
takis
parents: 279
diff changeset
53 */
82
8fb151c4d4c7 Move av_malloc(), av_realloc(), and av_free() from libavcodec to libavutil
lucabe
parents: 80
diff changeset
54 void av_free(void *ptr);
8fb151c4d4c7 Move av_malloc(), av_realloc(), and av_free() from libavcodec to libavutil
lucabe
parents: 80
diff changeset
55
113
8fc54918226e move memory functions from avcodec to avutil
lu_zero
parents: 112
diff changeset
56 void *av_mallocz(unsigned int size);
8fc54918226e move memory functions from avcodec to avutil
lu_zero
parents: 112
diff changeset
57 char *av_strdup(const char *s);
281
411c8cbd578a Move unaltered av_freep() comments to the header file.
takis
parents: 280
diff changeset
58
411c8cbd578a Move unaltered av_freep() comments to the header file.
takis
parents: 280
diff changeset
59 /**
411c8cbd578a Move unaltered av_freep() comments to the header file.
takis
parents: 280
diff changeset
60 * Frees memory and sets the pointer to NULL.
284
4dd91a7d8633 Fix typo in Doxygen comments.
takis
parents: 281
diff changeset
61 * @param ptr pointer to the pointer which should be freed
281
411c8cbd578a Move unaltered av_freep() comments to the header file.
takis
parents: 280
diff changeset
62 */
113
8fc54918226e move memory functions from avcodec to avutil
lu_zero
parents: 112
diff changeset
63 void av_freep(void *ptr);
8fc54918226e move memory functions from avcodec to avutil
lu_zero
parents: 112
diff changeset
64
286
c1d6b0378055 Move the memory related functions out of common.h into their own header file
takis
parents: 284
diff changeset
65 #endif /* AV_MEM_H */