1BSON_ALIGNED_ALLOC0(3) libbson BSON_ALIGNED_ALLOC0(3)
2
3
4
6 bson_aligned_alloc0 - bson_aligned_alloc0()
7
9 void *
10 bson_aligned_alloc0 (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 that also sets the memory to
21 zero.
22
23 In general, this function will return an allocation at least
24 sizeof(void*) bytes or bigger with an alignment of at least alignment.
25
26 If there was a failure to allocate num_bytes bytes aligned to align‐
27 ment, the process will be aborted.
28
29 WARNING:
30 This function will abort on failure to allocate memory.
31
33 A pointer to a memory region which HAS been zeroed.
34
36 MongoDB, Inc
37
39 2017-present, MongoDB, Inc
40
41
42
43
441.24.3 Aug 17, 2023 BSON_ALIGNED_ALLOC0(3)