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 #ifndef MCA_ALLOCATOR_H
26 #define MCA_ALLOCATOR_H
27
28 #include "opal_config.h"
29 #include "opal/mca/mca.h"
30
31 BEGIN_C_DECLS
32
33
34 struct mca_allocator_base_module_t;
35
36
37
38
39 typedef void* (*mca_allocator_base_module_alloc_fn_t)(
40 struct mca_allocator_base_module_t*,
41 size_t size,
42 size_t align);
43
44
45
46
47 typedef void* (*mca_allocator_base_module_realloc_fn_t)(
48 struct mca_allocator_base_module_t*,
49 void*, size_t);
50
51
52
53
54 typedef void(*mca_allocator_base_module_free_fn_t)(
55 struct mca_allocator_base_module_t*, void *);
56
57
58
59
60
61
62 typedef int (*mca_allocator_base_module_compact_fn_t)(
63 struct mca_allocator_base_module_t* allocator
64 );
65
66
67
68
69
70
71 typedef int (*mca_allocator_base_module_finalize_fn_t)(
72 struct mca_allocator_base_module_t* allocator
73 );
74
75
76
77
78 struct mca_allocator_base_module_t {
79 mca_allocator_base_module_alloc_fn_t alc_alloc;
80
81 mca_allocator_base_module_realloc_fn_t alc_realloc;
82
83 mca_allocator_base_module_free_fn_t alc_free;
84
85 mca_allocator_base_module_compact_fn_t alc_compact;
86
87 mca_allocator_base_module_finalize_fn_t alc_finalize;
88
89
90 void *alc_context;
91 };
92
93
94
95 typedef struct mca_allocator_base_module_t mca_allocator_base_module_t;
96
97
98
99
100
101
102
103 typedef void* (*mca_allocator_base_component_segment_alloc_fn_t)(void *ctx,
104 size_t *size);
105
106
107
108
109
110
111 typedef void (*mca_allocator_base_component_segment_free_fn_t)(void *ctx,
112 void *segment);
113
114
115
116
117
118 typedef struct mca_allocator_base_module_t*
119 (*mca_allocator_base_component_init_fn_t)(
120 bool enable_mpi_threads,
121 mca_allocator_base_component_segment_alloc_fn_t segment_alloc,
122 mca_allocator_base_component_segment_free_fn_t segment_free,
123 void *context
124 );
125
126
127
128
129
130 struct mca_allocator_base_component_2_0_0_t {
131 mca_base_component_t allocator_version;
132
133 mca_base_component_data_t allocator_data;
134
135 mca_allocator_base_component_init_fn_t allocator_init;
136
137 };
138
139
140
141
142 typedef struct mca_allocator_base_component_2_0_0_t mca_allocator_base_component_t;
143
144
145
146
147 #define MCA_ALLOCATOR_BASE_VERSION_2_0_0 \
148 OPAL_MCA_BASE_VERSION_2_1_0("allocator", 2, 0, 0)
149
150 END_C_DECLS
151
152 #endif
153