Coverage Report

Created: 2025-11-24 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libcbor/src/allocators.c
Line
Count
Source
1
/*
2
 * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
3
 *
4
 * libcbor is free software; you can redistribute it and/or modify
5
 * it under the terms of the MIT license. See LICENSE for details.
6
 */
7
8
#include "cbor/common.h"
9
10
CBOR_EXPORT _cbor_malloc_t _cbor_malloc = malloc;
11
CBOR_EXPORT _cbor_realloc_t _cbor_realloc = realloc;
12
CBOR_EXPORT _cbor_free_t _cbor_free = free;
13
14
void cbor_set_allocs(_cbor_malloc_t custom_malloc,
15
3
                     _cbor_realloc_t custom_realloc, _cbor_free_t custom_free) {
16
3
  _cbor_malloc = custom_malloc;
17
3
  _cbor_realloc = custom_realloc;
18
3
  _cbor_free = custom_free;
19
3
}