|
发表于 2013-10-17 15:54:20
|
显示全部楼层
- 63 #if AV_GCC_VERSION_AT_LEAST(3,1)
- 64 #define av_malloc_attrib __attribute__((__malloc__))
- 65 #else
- 66 #define av_malloc_attrib
- 67 #endif
- 68
- 69 #if AV_GCC_VERSION_AT_LEAST(4,3)
- 70 #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
- 71 #else
- 72 #define av_alloc_size(...)
- 73 #endif
- 74
- 75 /**
- 76 * Allocate a block of size bytes with alignment suitable for all
- 77 * memory accesses (including vectors if available on the CPU).
- 78 * @param size Size in bytes for the memory block to be allocated.
- 79 * @return Pointer to the allocated block, NULL if the block cannot
- 80 * be allocated.
- 81 * @see av_mallocz()
- 82 */
- 83 void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
复制代码 其实就是根据编译器重新定义了一下 |
|