1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/hashtable: Mark alloc,free functions as av_cold

Reviewed-by: Emma Worley <emma@emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-03 22:47:26 +02:00
parent 12a43975d1
commit 06958c731e

View File

@ -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);