summaryrefslogtreecommitdiff
path: root/libavutil/mem.h
Commit message (Collapse)AuthorAge
* avutil/mem: Fix invalid use of av_alloc_sizeMark Harris2018-11-26
| | | | | | | | | | | The alloc_size attribute is valid only on functions that return a pointer. GCC 9 (not yet released) warns about invalid usage: ./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes] 342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); | ^~~~~~~~~~~~~ Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mem: Correct documentation of av_fast_*alloc(z)Andreas Rheinhardt2018-11-18
| | | | | | | | | The current wording regarding size and min_size is completely wrong and ignores that min_size is indeed only a desired minimal size, not the actually allocated size. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mem: Add DECLARE_ASM_ALIGNED macro for DJGPP architecture.Thomas Köppe2017-12-02
| | | | | | The macro was added in 43171a2a738f5114768d34a7278e56e5fde714bc, but I forgot to add it to the DJGPP architecture in that change. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix missing used attribute for inline assembly variablesThomas Köppe2017-11-13
| | | | | | | | | | | | | Variables used in inline assembly need to be marked with attribute((used)). Static constants already were, via the define of DECLARE_ASM_CONST. But DECLARE_ALIGNED does not add this attribute, and some of the variables defined with it are const only used in inline assembly, and therefore appeared dead. This change adds a macro DECLARE_ASM_ALIGNED that marks variables as used. This change makes FFMPEG work with Clang's ThinLTO. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '0af8a72174108b9bb482f1073a1e9a3bc258af51'James Almer2017-11-11
|\ | | | | | | | | | | | | * commit '0af8a72174108b9bb482f1073a1e9a3bc258af51': build: Drop support for legacy TI ARM compiler Merged-by: James Almer <jamrial@gmail.com>
| * build: Drop support for legacy TI ARM compilerDiego Biurrun2017-10-25
| |
* | Merge commit '04b0f0e371ff81b682274b574fb465ba4395c09f'James Almer2017-10-30
|\| | | | | | | | | | | | | * commit '04b0f0e371ff81b682274b574fb465ba4395c09f': mem: uninline av_malloc(z)_array() Merged-by: James Almer <jamrial@gmail.com>
| * mem: uninline av_malloc(z)_array()Anton Khirnov2017-04-26
| | | | | | | | | | | | Inlining public functions hardcodes their implementation into the ABI, so it should be avoided unless there is a very good reason for it. No such reason exists in this case.
* | lavu/mem: clamp alignment to 16 for DJGPPClément Bœsch2017-03-29
| | | | | | | | See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80208
* | Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'Clément Bœsch2017-02-02
|\| | | | | | | | | | | | | * commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5': libavutil: Always use some GCC style attributes on clang Merged-by: Clément Bœsch <cboesch@gopro.com>
| * libavutil: Always use some GCC style attributes on clangMartin Storsjö2016-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang normally disguises as GCC (defining __GNUC__), and thus get all the normal GCC specific attributes. Clang can also work as a drop-in replacement for MSVC, and in these cases, it doesn't define __GNUC__, but defines _MSC_VER instead. Even in these setups, it still supports the GCC style attributes, thus use them, especially where there isn't any MSVC specific version, or where the MSVC specific version doesn't work on clang (for DECLARE_ASM_CONST). Signed-off-by: Martin Storsjö <martin@martin.st>
* | avutil/mem: remove av_realloc / av_malloc incompatibility warningMichael Niedermayer2016-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memalign() is not guranteed to be compatible with free() or realloc() and for platforms in this category we have --enable-memalign-hack (which should be enabled automatically if such system is detected) Trying to somehow half support systems that can free() memalign memory but not reallocate it seems not worth the amount of work needed to keep 2 then incompatible allocation systems and ensure their seperation. That is unless this would affect a major platform on which we want to avoid the memalign hack code The warnings also cause wasted time and effort as people try to maintain a separation that does not exist currently. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mem: Extend and edit DoxygenTimothy Gu2016-08-21
| |
* | mem: Order function prototypes semanticallyTimothy Gu2016-08-02
| |
* | avutil/mem: fix wrong commentZhao Zhili2016-07-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/mem: Add av_fast_mallocz()Michael Niedermayer2015-11-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/mem: add av_warn_unused_resultGanesh Ajjanagadde2015-10-16
| | | | | | | | | | | | | | | | This adds av_warn_unused_result to functions whose return codes need to be checked. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | Merge commit '8ddc32629a6d6be77256694c9e322dde134609f3'Michael Niedermayer2014-08-14
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '8ddc32629a6d6be77256694c9e322dde134609f3': mem: add av_strndup() for duplicating substrings Conflicts: libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: add av_strndup() for duplicating substringsAnton Khirnov2014-08-13
| |
* | avutil/mem: document NULL related saftey of av_freep()Michael Niedermayer2014-08-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/mem: add av_dynarray_add_nofree functionLukasz Marek2014-03-29
| | | | | | | | | | | | | | | | av_dynarray_add_nofree function have similar functionality as existing av_dynarray_add, but it doesn't deallocate memory on fails. Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* | Merge commit 'cce3e0a49f0dd030262c28d9c53de0bd2fd909c4'Michael Niedermayer2013-11-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cce3e0a49f0dd030262c28d9c53de0bd2fd909c4': Move av_fast_{m,re}alloc from lavc to lavu. Conflicts: libavcodec/avcodec.h libavcodec/utils.c libavutil/mem.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move av_fast_{m,re}alloc from lavc to lavu.Anton Khirnov2013-11-14
| |
* | Merge commit 'b284e1ffe343d6697fb950d1ee517bafda8a9844'Michael Niedermayer2013-10-26
|\| | | | | | | | | | | | | * commit 'b284e1ffe343d6697fb950d1ee517bafda8a9844': mem: do not check for negative size Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: do not check for negative sizeVittorio Giovara2013-10-26
| | | | | | | | | | | | size_t is guaranteed to be unsigned Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '3feb3d6ce4be0a09a9f8f13d613bed25b523b6e7'Michael Niedermayer2013-09-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '3feb3d6ce4be0a09a9f8f13d613bed25b523b6e7': mem: Introduce av_reallocp Conflicts: doc/APIchanges libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Introduce av_reallocpLuca Barbato2013-09-16
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-09-15
|\| | | | | | | | | | | | | * qatar/master: mem: Document the non-compatibility of av_realloc() and av_malloc() Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Document the non-compatibility of av_realloc() and av_malloc()Diego Biurrun2013-09-14
| |
* | Merge commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040'Michael Niedermayer2013-09-06
|\| | | | | | | | | | | | | | | | | | | | | * commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040': mem: Improve documentation wording and spelling Conflicts: libavutil/mem.c libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Improve documentation wording and spellingDiego Biurrun2013-09-05
| |
* | Merge commit 'b4ec7a5fee644ad9882e10c097817b65447b8e55'Michael Niedermayer2013-09-04
|\| | | | | | | | | | | | | * commit 'b4ec7a5fee644ad9882e10c097817b65447b8e55': mem: Document the av_realloc family of functions properly Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Document the av_realloc family of functions properlyLuca Barbato2013-09-04
| | | | | | | | realloc() does not accept pointers from memalign().
* | Merge commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e'Michael Niedermayer2013-06-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e': movenc: Keep track of the allocated size for the cluster array mem: Add av_realloc_array and av_reallocp_array Conflicts: doc/APIchanges libavformat/movenc.c libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Add av_realloc_array and av_reallocp_arrayMartin Storsjö2013-06-04
| | | | | | | | | | | | These help avoiding overflows and simplify error handling. Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavu/mem: add av_dynarray2_add()Stefano Sabatini2013-05-13
| | | | | | | | | | | | | | | | | | Based on a patch by Clément Bœsch. See thread: From: Clément Bœsch <ubitux@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/5] lavu: add av_dynarray_alloc_elem(). Date: Sun, 14 Apr 2013 03:07:54 +0200
* | lavu/mem.h: fix typoStefano Sabatini2013-05-10
| |
* | lavu/mem: fix potential int overflow and crash in av_dynarray_add()Stefano Sabatini2013-05-08
| | | | | | | | Also extend documentation accordingly.
* | lavu/mem: extend documentation for av_dynarray_add()Stefano Sabatini2013-05-08
| | | | | | | | | | In particular, mention the fact that the amortized element addition cost is constant.
* | avutil/mem: add av_memdup()Michael Niedermayer2013-05-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avutil: Make LZO decoder code configure-time selectable avutil: Move memcpy_backptr() to mem.c configure: detect parisc64 automatically configure: detect ppc64 automatically configure: detect mips64 automatically configure: generalise 64-bit test smoothstreamingenc: Don't assume streams start from timestamp 0 Conflicts: configure libavutil/Makefile libavutil/lzo.c libavutil/lzo.h libavutil/mem.c libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Move memcpy_backptr() to mem.cDiego Biurrun2012-10-25
| | | | | | | | The function is used elsewhere and does not belong with the LZO code.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Group math functions into a separate variable avutil/mem: K&R formatting cosmetics avutil/lzo: K&R formatting cosmetics Conflicts: configure libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil/mem: K&R formatting cosmeticsDiego Biurrun2012-10-20
| |
| * mem: fix typo in check for __ICCMans Rullgard2012-09-10
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't include common.h from avutil.hMartin Storsjö2012-08-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Check for CommandLineToArgvW vc1dec: Do not use random pred_flag if motion vector data is skipped vp8: Enclose pthread function calls in ifdefs snow: refactor code to work around a compiler bug in MSVC. vp8: Include the thread headers before using the pthread types configure: Check for getaddrinfo in ws2tcpip.h, too vp8: implement sliced threading vp8: move data from VP8Context->VP8Macroblock vp8: refactor decoding a single mb_row doc: update api changes with the right commit hashes mem: introduce av_malloc_array and av_mallocz_array Conflicts: configure doc/APIchanges libavcodec/vp8.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: introduce av_malloc_array and av_mallocz_arrayLuca Barbato2012-07-14
| | | | | | | | | | Both function ease allocating large arrays implementing the overflow check inside it.
* | mem: add av_max_alloc() to limit the maximum amount that may be allocated in ↵Michael Niedermayer2011-12-25
| | | | | | | | | | | | one piece Signed-off-by: Michael Niedermayer <michaelni@gmx.at>