1BSON_ALIGNED_ALLOC(3) libbson BSON_ALIGNED_ALLOC(3)
2
3
4
6 bson_aligned_alloc - bson_aligned_alloc()
7
9 void *
10 bson_aligned_alloc (size_t alignment, size_t num_bytes);
11
13 • alignment: The alignment of the allocated bytes of memory. Must be a
14 power of 2 and a multiple of sizeof (void *).
15
16 • num_bytes: The number of bytes to allocate. Must be a multiple of
17 alignment.
18
20 This is a portable aligned_alloc() wrapper.
21
22 In general, this function will return an allocation at least
23 sizeof(void*) bytes or bigger with an alignment of at least alignment.
24
25 If there was a failure to allocate num_bytes bytes aligned to align‐
26 ment, the process will be aborted.
27
28 WARNING:
29 This function will abort on failure to allocate memory.
30
32 A pointer to a memory region which HAS NOT been zeroed.
33
35 MongoDB, Inc
36
38 2017-present, MongoDB, Inc
39
40
41
42
431.23.1 Oct 20, 2022 BSON_ALIGNED_ALLOC(3)