1BSON_MEM_SET_VTABLE(3) libbson BSON_MEM_SET_VTABLE(3)
2
3
4
6 bson_mem_set_vtable - bson_mem_set_vtable()
7
9 typedef struct _bson_mem_vtable_t {
10 void *(*malloc) (size_t num_bytes);
11 void *(*calloc) (size_t n_members, size_t num_bytes);
12 void *(*realloc) (void *mem, size_t num_bytes);
13 void (*free) (void *mem);
14 void *padding[4];
15 } bson_mem_vtable_t;
16
17 void
18 bson_mem_set_vtable (const bson_mem_vtable_t *vtable);
19
21 • vtable: A bson_mem_vtable_t with every non-padding field set.
22
24 This function shall install a new memory allocator to be used by Libb‐
25 son.
26
27 WARNING:
28 This function MUST be called at the beginning of the process. Fail‐
29 ure to do so will result in memory being freed by the wrong alloca‐
30 tor.
31
33 MongoDB, Inc
34
36 2017-present, MongoDB, Inc
37
38
39
40
411.17.6 Jun 03, 2021 BSON_MEM_SET_VTABLE(3)