bson_mem_set_vtable (3) - Linux Manuals
bson_mem_set_vtable: This function shall install a new memory allocator to be used by Libbson.
Command to display bson_mem_set_vtable
manual in Linux: $ man 3 bson_mem_set_vtable
NAME
bson_mem_set_table() - This function shall install a new memory allocator to be used by Libbson.
SYNOPSIS
typedef struct _bson_mem_vtable_t
{
void *(*malloc) (size_t num_bytes);
void *(*calloc) (size_t n_members,
size_t num_bytes);
void *(*realloc) (void *mem,
size_t num_bytes);
void (*free) (void *mem);
void *padding [4];
} bson_mem_vtable_t;
void bson_mem_set_vtable (const bson_mem_vtable_t *vtable);
PARAMETERS
- vtable
-
A bson_mem_vtable_t with every non-padding field set.
DESCRIPTION
This function shall install a new memory allocator to be used by Libbson.
NOTE
-
This function
MUST
be called at the beginning of the process. Failure to do so will result in memory being freed by the wrong allocator.
COLOPHON
This page is part of libbson.
Please report any bugs at
https://jira.mongodb.org/browse/CDRIVER.
Pages related to bson_mem_set_vtable
- bson_mem_restore_vtable (3) - This function shall restore the default memory allocator to be used by Libbson.
- bson_malloc (3) - This is a portable malloc() wrapper.
- bson_malloc0 (3) - This is a portable malloc() wrapper that also sets the memory to zero. Similar to calloc().
- bson_md5_append (3) - Feeds more data into the MD5 algorithm.
- bson_md5_finish (3) - Completes the MD5 algorithm and stores the digest in digest.
- bson_md5_init (3) - Initialize a new instance of the MD5 algorithm.
- bson_md5_t (3) - BSON MD5 Abstraction
- bson_append_array (3) - The bson_append_array() function shall append child to bson using the specified key. The type of the field will be an array, but it is the responsibility of the caller to ensure that the keys of child are properly formatted with string keys such as "0", "1", "2" and so forth.
- bson_append_array_begin (3) - The bson_append_array_begin() function shall begin appending an array field to bson. This allows for incrementally building a sub-array. Doing so will generally yield better performance as you will serialize to a single buffer. When done building the sub-array, the caller MUST call bson_append_array_end().