1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use std::os::raw::c_void;
#[repr(C)]
#[derive(Debug)]
pub struct rcutils_allocator_t {
pub allocate: Option<unsafe extern "C" fn(size: usize, state: *mut c_void) -> *mut c_void>,
pub deallocate: Option<unsafe extern "C" fn(pointer: *mut c_void, state: *mut c_void)>,
pub reallocate: Option<
unsafe extern "C" fn(pointer: *mut c_void, size: usize, state: *mut c_void) -> *mut c_void,
>,
pub zero_allocate: Option<
unsafe extern "C" fn(
number_of_elements: usize,
size_of_element: usize,
state: *mut c_void,
) -> *mut c_void,
>,
pub state: *mut c_void,
}
extern "C" {
pub fn rcutils_get_zero_initialized_allocator() -> rcutils_allocator_t;
pub fn rcutils_get_default_allocator() -> rcutils_allocator_t;
pub fn rcutils_allocator_is_valid(allocator: *const rcutils_allocator_t) -> bool;
pub fn rcutils_reallocf(
pointer: *mut c_void,
size: usize,
allocator: *mut rcutils_allocator_t,
) -> *mut c_void;
}