1BSON_ALIGNED_ALLOC0(3) libbson BSON_ALIGNED_ALLOC0(3)
2
3
4
6 void *
7 bson_aligned_alloc0 (size_t alignment, size_t num_bytes);
8
10 • alignment: The alignment of the allocated bytes of memory. Must be a
11 power of 2 and a multiple of sizeof (void *).
12
13 • num_bytes: The number of bytes to allocate. Must be a multiple of
14 alignment.
15
17 This is a portable aligned_alloc() wrapper that also sets the memory to
18 zero.
19
20 In general, this function will return an allocation at least
21 sizeof(void*) bytes or bigger with an alignment of at least alignment.
22
23 If there was a failure to allocate num_bytes bytes aligned to align‐
24 ment, the process will be aborted.
25
26 WARNING:
27 This function will abort on failure to allocate memory.
28
30 A pointer to a memory region which HAS been zeroed.
31
33 MongoDB, Inc
34
36 2017-present, MongoDB, Inc
37
38
39
40
411.25.1 Nov 08, 2023 BSON_ALIGNED_ALLOC0(3)