File: allocators.c

package info (click to toggle)
aws-crt-python 0.24.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 75,932 kB
  • sloc: ansic: 418,984; python: 23,626; makefile: 6,035; sh: 4,075; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (19 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
 *
 * libcbor is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#include "cbor/common.h"

CBOR_EXPORT _cbor_malloc_t _cbor_malloc = malloc;
CBOR_EXPORT _cbor_realloc_t _cbor_realloc = realloc;
CBOR_EXPORT _cbor_free_t _cbor_free = free;

void cbor_set_allocs(_cbor_malloc_t custom_malloc,
                     _cbor_realloc_t custom_realloc, _cbor_free_t custom_free) {
  _cbor_malloc = custom_malloc;
  _cbor_realloc = custom_realloc;
  _cbor_free = custom_free;
}