[FFmpeg-cvslog] avcodec/hashtable: Mark alloc,free functions as av_cold
Andreas Rheinhardt
git at videolan.org
Wed Jun 4 16:41:03 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jun 3 22:47:26 2025 +0200| [06958c731e8662ca0cfb50e49131fd2a6bfa185a] | committer: Andreas Rheinhardt
avcodec/hashtable: Mark alloc,free functions as av_cold
Reviewed-by: Emma Worley <emma at emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=06958c731e8662ca0cfb50e49131fd2a6bfa185a
---
libavcodec/hashtable.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/hashtable.c b/libavcodec/hashtable.c
index 9b37ce3d69..0e9b3d88c2 100644
--- a/libavcodec/hashtable.c
+++ b/libavcodec/hashtable.c
@@ -22,8 +22,10 @@
#include <stdint.h>
#include <string.h>
+#include "libavutil/attributes.h"
#include "libavutil/crc.h"
#include "libavutil/error.h"
+#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "hashtable.h"
@@ -54,7 +56,8 @@ struct FFHashtableContext {
#define KEYS_EQUAL(k1, k2) (!memcmp((k1), (k2), ctx->key_size))
-int ff_hashtable_alloc(struct FFHashtableContext **ctx, size_t key_size, size_t val_size, size_t max_entries)
+av_cold int ff_hashtable_alloc(FFHashtableContext **ctx, size_t key_size,
+ size_t val_size, size_t max_entries)
{
const size_t keyval_size = key_size + val_size;
@@ -200,7 +203,7 @@ void ff_hashtable_clear(struct FFHashtableContext *ctx)
memset(ctx->table, 0, ctx->entry_size * ctx->max_entries);
}
-void ff_hashtable_freep(struct FFHashtableContext **ctx)
+av_cold void ff_hashtable_freep(FFHashtableContext **ctx)
{
if (*ctx) {
av_freep(&(*ctx)->table);
More information about the ffmpeg-cvslog
mailing list