ARGOBOTS  1.1
abti_mem.h
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #ifndef ABTI_MEM_H_INCLUDED
7 #define ABTI_MEM_H_INCLUDED
8 
9 /* Memory allocation */
10 
11 /* Round desc_size up to the cacheline size. The last four bytes will be
12  * used to determine whether the descriptor is allocated externally (i.e.,
13  * malloc()) or taken from a memory pool. */
14 #define ABTI_MEM_POOL_DESC_ELEM_SIZE \
15  ABTU_roundup_size(sizeof(ABTI_thread), ABT_CONFIG_STATIC_CACHELINE_SIZE)
16 
17 enum {
23 };
24 
27  ABTI_xstream *p_local_xstream);
28 void ABTI_mem_finalize(ABTI_global *p_global);
29 void ABTI_mem_finalize_local(ABTI_xstream *p_local_xstream);
30 int ABTI_mem_check_lp_alloc(ABTI_global *p_global, int lp_alloc);
31 
32 #define ABTI_STACK_CANARY_VALUE ((uint64_t)0xbaadc0debaadc0de)
33 
34 /* Inline functions */
35 static inline void ABTI_mem_register_stack(void *p_stack, size_t stacksize)
36 {
37 #if ABT_CONFIG_STACK_CHECK_TYPE == ABTI_STACK_CHECK_TYPE_CANARY
38  /* Write down stack canary. */
39  if (p_stack) {
40  uint64_t i;
41  for (i = 0;
43  i += sizeof(uint64_t)) {
44  ((uint64_t *)p_stack)[i] = ABTI_STACK_CANARY_VALUE;
45  }
46  }
47 #endif
48  ABTI_VALGRIND_REGISTER_STACK(p_stack, stacksize);
49 }
50 
51 static inline void ABTI_mem_unregister_stack(void *p_stack)
52 {
53 #if ABT_CONFIG_STACK_CHECK_TYPE == ABTI_STACK_CHECK_TYPE_CANARY
54  if (p_stack) {
55  uint64_t i;
56  for (i = 0;
58  i += sizeof(uint64_t)) {
59  ABTI_ASSERT(((uint64_t *)p_stack)[i] == ABTI_STACK_CANARY_VALUE);
60  }
61  }
62 #endif
64 }
65 
66 ABTU_ret_err static inline int
68 {
69  ABTI_thread *p_thread;
70  int abt_errno =
71  ABTU_malloc(ABTI_MEM_POOL_DESC_ELEM_SIZE, (void **)&p_thread);
72  ABTI_CHECK_ERROR(abt_errno);
73  p_thread->type = ABTI_THREAD_TYPE_MEM_MALLOC_DESC;
74  *pp_thread = p_thread;
75  return ABT_SUCCESS;
76 }
77 
78 #ifdef ABT_CONFIG_USE_MEM_POOL
79 ABTU_ret_err static inline int
80 ABTI_mem_alloc_nythread_mempool(ABTI_local *p_local, ABTI_thread **pp_thread)
81 {
82  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
83  if (ABTI_IS_EXT_THREAD_ENABLED && p_local_xstream == NULL) {
84  /* For external threads */
85  return ABTI_mem_alloc_nythread_malloc(pp_thread);
86  }
87  /* Find the page that has an empty block */
88  ABTI_thread *p_thread;
89  int abt_errno = ABTI_mem_pool_alloc(&p_local_xstream->mem_pool_desc,
90  (void **)&p_thread);
91  ABTI_CHECK_ERROR(abt_errno);
93  *pp_thread = p_thread;
94  return ABT_SUCCESS;
95 }
96 #endif
97 
98 ABTU_ret_err static inline int ABTI_mem_alloc_nythread(ABTI_local *p_local,
99  ABTI_thread **pp_thread)
100 {
101 #ifdef ABT_CONFIG_USE_MEM_POOL
102  return ABTI_mem_alloc_nythread_mempool(p_local, pp_thread);
103 #else
104  return ABTI_mem_alloc_nythread_malloc(pp_thread);
105 #endif
106 }
107 
108 static inline void ABTI_mem_free_nythread(ABTI_global *p_global,
109  ABTI_local *p_local,
110  ABTI_thread *p_thread)
111 {
112  /* Return stack. */
113 #ifdef ABT_CONFIG_USE_MEM_POOL
114  if (p_thread->type & ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC) {
115  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
116  /* Came from a memory pool. */
117 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD
118  if (p_local_xstream == NULL) {
119  /* Return a stack to the global pool. */
120  ABTD_spinlock_acquire(&p_global->mem_pool_desc_lock);
121  ABTI_mem_pool_free(&p_global->mem_pool_desc_ext, p_thread);
122  ABTD_spinlock_release(&p_global->mem_pool_desc_lock);
123  return;
124  }
125 #endif
126  ABTI_mem_pool_free(&p_local_xstream->mem_pool_desc, p_thread);
127  return;
128  }
129 #endif
130  /* p_thread was allocated by malloc() */
131  ABTU_free(p_thread);
132 }
133 
134 #ifdef ABT_CONFIG_USE_MEM_POOL
135 ABTU_ret_err static inline int ABTI_mem_alloc_ythread_mempool_desc_stack_impl(
136  ABTI_mem_pool_local_pool *p_mem_pool_stack, size_t stacksize,
137  ABTI_ythread **pp_ythread, void **pp_stack)
138 {
139  /* stacksize must be a multiple of ABT_CONFIG_STATIC_CACHELINE_SIZE. */
140  ABTI_ASSERT((stacksize & (ABT_CONFIG_STATIC_CACHELINE_SIZE - 1)) == 0);
141  void *p_ythread;
142  int abt_errno = ABTI_mem_pool_alloc(p_mem_pool_stack, &p_ythread);
143  ABTI_CHECK_ERROR(abt_errno);
144 
145  *pp_stack = (void *)(((char *)p_ythread) - stacksize);
146  *pp_ythread = (ABTI_ythread *)p_ythread;
147  return ABT_SUCCESS;
148 }
149 #endif
150 
152  size_t stacksize, ABTI_ythread **pp_ythread, void **pp_stack)
153 {
154  /* stacksize must be a multiple of ABT_CONFIG_STATIC_CACHELINE_SIZE. */
155  size_t alloc_stacksize =
157  char *p_stack;
158  int abt_errno =
159  ABTU_malloc(alloc_stacksize + sizeof(ABTI_ythread), (void **)&p_stack);
160  ABTI_CHECK_ERROR(abt_errno);
161 
162  *pp_stack = (void *)p_stack;
163  *pp_ythread = (ABTI_ythread *)(p_stack + alloc_stacksize);
164  return ABT_SUCCESS;
165 }
166 
167 ABTU_ret_err static inline int
169  ABTI_ythread **pp_ythread)
170 {
171  size_t stacksize = p_global->thread_stacksize;
172  ABTI_ythread *p_ythread;
173  void *p_stack;
174  /* If an external thread allocates a stack, we use ABTU_malloc. */
175  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
176  if (ABTI_IS_EXT_THREAD_ENABLED && p_local_xstream == NULL) {
177  int abt_errno =
178  ABTI_mem_alloc_ythread_malloc_desc_stack_impl(stacksize, &p_ythread,
179  &p_stack);
180  ABTI_CHECK_ERROR(abt_errno);
182  } else {
183 #ifdef ABT_CONFIG_USE_MEM_POOL
184  int abt_errno = ABTI_mem_alloc_ythread_mempool_desc_stack_impl(
185  &p_local_xstream->mem_pool_stack, stacksize, &p_ythread, &p_stack);
186  ABTI_CHECK_ERROR(abt_errno);
188 #else
189  int abt_errno =
190  ABTI_mem_alloc_ythread_malloc_desc_stack_impl(stacksize, &p_ythread,
191  &p_stack);
192  ABTI_CHECK_ERROR(abt_errno);
194 #endif
195  }
196  /* Initialize members of ABTI_thread_attr. */
197  p_ythread->p_stack = p_stack;
198  p_ythread->stacksize = stacksize;
199  ABTI_mem_register_stack(p_ythread->p_stack, p_ythread->stacksize);
200  *pp_ythread = p_ythread;
201  return ABT_SUCCESS;
202 }
203 
204 #ifdef ABT_CONFIG_USE_MEM_POOL
205 ABTU_ret_err static inline int ABTI_mem_alloc_ythread_mempool_desc_stack(
206  ABTI_global *p_global, ABTI_local *p_local, ABTI_thread_attr *p_attr,
207  ABTI_ythread **pp_ythread)
208 {
209  size_t stacksize = p_global->thread_stacksize;
210  ABTI_ythread *p_ythread;
211  void *p_stack;
212  /* If an external thread allocates a stack, we use ABTU_malloc. */
213  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
214  if (ABTI_IS_EXT_THREAD_ENABLED && p_local_xstream == NULL) {
215  int abt_errno =
216  ABTI_mem_alloc_ythread_malloc_desc_stack_impl(stacksize, &p_ythread,
217  &p_stack);
218  ABTI_CHECK_ERROR(abt_errno);
220  } else {
221  int abt_errno = ABTI_mem_alloc_ythread_mempool_desc_stack_impl(
222  &p_local_xstream->mem_pool_stack, stacksize, &p_ythread, &p_stack);
223  ABTI_CHECK_ERROR(abt_errno);
225  }
226  /* Copy members of p_attr. */
227  p_ythread->p_stack = p_stack;
228  p_ythread->stacksize = stacksize;
229  ABTI_mem_register_stack(p_ythread->p_stack, p_ythread->stacksize);
230  *pp_ythread = p_ythread;
231  return ABT_SUCCESS;
232 }
233 #endif
234 
235 ABTU_ret_err static inline int
237  ABTI_ythread **pp_ythread)
238 {
239  size_t stacksize = p_attr->stacksize;
240  ABTI_ythread *p_ythread;
241  void *p_stack;
242  int abt_errno =
243  ABTI_mem_alloc_ythread_malloc_desc_stack_impl(stacksize, &p_ythread,
244  &p_stack);
245  ABTI_CHECK_ERROR(abt_errno);
246 
247  /* Copy members of p_attr. */
249  p_ythread->stacksize = stacksize;
250  p_ythread->p_stack = p_stack;
251  ABTI_mem_register_stack(p_ythread->p_stack, p_ythread->stacksize);
252  *pp_ythread = p_ythread;
253  return ABT_SUCCESS;
254 }
255 
257  ABTI_local *p_local, ABTI_thread_attr *p_attr, ABTI_ythread **pp_ythread)
258 {
259  ABTI_ythread *p_ythread;
261  /* Use a descriptor pool for ABT_thread. */
262  ABTI_STATIC_ASSERT(offsetof(ABTI_ythread, thread) == 0);
263  int abt_errno =
264  ABTI_mem_alloc_nythread(p_local, (ABTI_thread **)&p_ythread);
265  ABTI_CHECK_ERROR(abt_errno);
266  } else {
267  /* Do not allocate stack, but Valgrind registration is preferred. */
268  int abt_errno = ABTU_malloc(sizeof(ABTI_ythread), (void **)&p_ythread);
269  ABTI_CHECK_ERROR(abt_errno);
270  p_ythread->thread.type = ABTI_THREAD_TYPE_MEM_MALLOC_DESC;
271  }
272  /* Copy members of p_attr. */
273  p_ythread->stacksize = p_attr->stacksize;
274  p_ythread->p_stack = p_attr->p_stack;
275  /* Note that the valgrind registration is ignored if p_stack is NULL. */
276  ABTI_mem_register_stack(p_ythread->p_stack, p_ythread->stacksize);
277  *pp_ythread = p_ythread;
278  return ABT_SUCCESS;
279 }
280 
281 static inline void ABTI_mem_free_thread(ABTI_global *p_global,
282  ABTI_local *p_local,
283  ABTI_thread *p_thread)
284 {
285  /* Return stack. */
286 #ifdef ABT_CONFIG_USE_MEM_POOL
288  ABTI_ythread *p_ythread = ABTI_thread_get_ythread(p_thread);
290 
291  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
292  /* Came from a memory pool. */
293 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD
294  if (p_local_xstream == NULL) {
295  /* Return a stack to the global pool. */
296  ABTD_spinlock_acquire(&p_global->mem_pool_stack_lock);
297  ABTI_mem_pool_free(&p_global->mem_pool_stack_ext, p_ythread);
298  ABTD_spinlock_release(&p_global->mem_pool_stack_lock);
299  return;
300  }
301 #endif
302  ABTI_mem_pool_free(&p_local_xstream->mem_pool_stack, p_ythread);
303  } else
304 #endif
305  if (p_thread->type & ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC) {
306  /* Non-yieldable thread or yieldable thread without stack. */
307  ABTI_ythread *p_ythread = ABTI_thread_get_ythread_or_null(p_thread);
308  if (p_ythread)
310  ABTI_mem_free_nythread(p_global, p_local, p_thread);
311  } else if (p_thread->type & ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK) {
312  ABTI_ythread *p_ythread = ABTI_thread_get_ythread(p_thread);
314  ABTU_free(p_ythread->p_stack);
315  } else {
317  ABTI_STATIC_ASSERT(offsetof(ABTI_ythread, thread) == 0);
318  ABTI_ythread *p_ythread = ABTI_thread_get_ythread_or_null(p_thread);
319  if (p_ythread)
321  ABTU_free(p_thread);
322  }
323 }
324 
325 /* Generic scalable memory pools. It uses a memory pool for ABTI_thread.
326  * The last four bytes will be used to determine whether the descriptor is
327  * allocated externally (i.e., malloc()) or taken from a memory pool. */
328 #define ABTI_MEM_POOL_DESC_SIZE (ABTI_MEM_POOL_DESC_ELEM_SIZE - 4)
329 
330 ABTU_ret_err static inline int ABTI_mem_alloc_desc(ABTI_local *p_local,
331  void **pp_desc)
332 {
333 #ifndef ABT_CONFIG_USE_MEM_POOL
334  return ABTU_malloc(ABTI_MEM_POOL_DESC_SIZE, pp_desc);
335 #else
336  void *p_desc;
337  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
338  if (ABTI_IS_EXT_THREAD_ENABLED && p_local_xstream == NULL) {
339  /* For external threads */
340  int abt_errno = ABTU_malloc(ABTI_MEM_POOL_DESC_SIZE, &p_desc);
341  ABTI_CHECK_ERROR(abt_errno);
342  *(uint32_t *)(((char *)p_desc) + ABTI_MEM_POOL_DESC_SIZE) = 1;
343  *pp_desc = p_desc;
344  return ABT_SUCCESS;
345  } else {
346  /* Find the page that has an empty block */
347  int abt_errno =
348  ABTI_mem_pool_alloc(&p_local_xstream->mem_pool_desc, &p_desc);
349  ABTI_CHECK_ERROR(abt_errno);
350  /* To distinguish it from a malloc'ed case, assign non-NULL value. */
351  *(uint32_t *)(((char *)p_desc) + ABTI_MEM_POOL_DESC_SIZE) = 0;
352  *pp_desc = p_desc;
353  return ABT_SUCCESS;
354  }
355 #endif
356 }
357 
358 static inline void ABTI_mem_free_desc(ABTI_global *p_global,
359  ABTI_local *p_local, void *p_desc)
360 {
361 #ifndef ABT_CONFIG_USE_MEM_POOL
362  ABTU_free(p_desc);
363 #else
364  ABTI_xstream *p_local_xstream = ABTI_local_get_xstream_or_null(p_local);
365 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD
366  if (*(uint32_t *)(((char *)p_desc) + ABTI_MEM_POOL_DESC_SIZE)) {
367  /* This was allocated by an external thread. */
368  ABTU_free(p_desc);
369  return;
370  } else if (!p_local_xstream) {
371  /* Return a stack and a descriptor to their global pools. */
372  ABTD_spinlock_acquire(&p_global->mem_pool_desc_lock);
373  ABTI_mem_pool_free(&p_global->mem_pool_desc_ext, p_desc);
374  ABTD_spinlock_release(&p_global->mem_pool_desc_lock);
375  return;
376  }
377 #endif
378  ABTI_mem_pool_free(&p_local_xstream->mem_pool_desc, p_desc);
379 #endif
380 }
381 
382 #endif /* ABTI_MEM_H_INCLUDED */
ABTI_mem_free_thread
static void ABTI_mem_free_thread(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
Definition: abti_mem.h:281
ABTI_MEM_LP_MMAP_HP_THP
@ ABTI_MEM_LP_MMAP_HP_THP
Definition: abti_mem.h:21
ABTI_mem_pool_local_pool
Definition: abti_mem_pool.h:90
ABTU_roundup_size
static size_t ABTU_roundup_size(size_t val, size_t multiple)
Definition: abtu.h:95
ABTI_thread::type
ABTI_thread_type type
Definition: abti.h:375
ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC
#define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC
Definition: abti.h:90
ABTI_CHECK_ERROR
#define ABTI_CHECK_ERROR(abt_errno)
Definition: abti_error.h:120
ABTI_mem_alloc_nythread
static ABTU_ret_err int ABTI_mem_alloc_nythread(ABTI_local *p_local, ABTI_thread **pp_thread)
Definition: abti_mem.h:98
ABTI_ythread::stacksize
size_t stacksize
Definition: abti.h:410
ABTI_MEM_LP_MALLOC
@ ABTI_MEM_LP_MALLOC
Definition: abti_mem.h:18
ABTI_thread_get_ythread
static ABTI_ythread * ABTI_thread_get_ythread(ABTI_thread *p_thread)
Definition: abti_thread.h:52
ABTI_MEM_POOL_DESC_SIZE
#define ABTI_MEM_POOL_DESC_SIZE
Definition: abti_mem.h:328
ABTI_mem_alloc_desc
static ABTU_ret_err int ABTI_mem_alloc_desc(ABTI_local *p_local, void **pp_desc)
Definition: abti_mem.h:330
ABTI_mem_register_stack
static void ABTI_mem_register_stack(void *p_stack, size_t stacksize)
Definition: abti_mem.h:35
ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC_STACK
#define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC_STACK
Definition: abti.h:92
ABTI_mem_unregister_stack
static void ABTI_mem_unregister_stack(void *p_stack)
Definition: abti_mem.h:51
ABTI_thread
Definition: abti.h:371
ABTI_xstream
Definition: abti.h:264
ABTI_thread_attr
Definition: abti.h:388
ABTI_mem_init
ABTU_ret_err int ABTI_mem_init(ABTI_global *p_global)
Definition: malloc.c:181
ABTI_mem_free_nythread
static void ABTI_mem_free_nythread(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
Definition: abti_mem.h:108
ABTI_VALGRIND_REGISTER_STACK
#define ABTI_VALGRIND_REGISTER_STACK(p_stack, size)
Definition: abti_valgrind.h:32
ABTI_MEM_LP_THP
@ ABTI_MEM_LP_THP
Definition: abti_mem.h:22
ABTI_mem_pool_alloc
static ABTU_ret_err int ABTI_mem_pool_alloc(ABTI_mem_pool_local_pool *p_local_pool, void **p_mem)
Definition: abti_mem_pool.h:116
ABTI_thread_get_ythread_or_null
static ABTI_ythread * ABTI_thread_get_ythread_or_null(ABTI_thread *p_thread)
Definition: abti_thread.h:59
ABTI_global::thread_stacksize
size_t thread_stacksize
Definition: abti.h:209
ABTD_spinlock_acquire
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
Definition: abtd_spinlock.h:28
ABTI_mem_alloc_ythread_malloc_desc_stack_impl
static ABTU_ret_err int ABTI_mem_alloc_ythread_malloc_desc_stack_impl(size_t stacksize, ABTI_ythread **pp_ythread, void **pp_stack)
Definition: abti_mem.h:151
ABTU_malloc
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
Definition: abtu.h:262
ABTI_MEM_LP_MMAP_HP_RP
@ ABTI_MEM_LP_MMAP_HP_RP
Definition: abti_mem.h:20
ABTI_mem_finalize
void ABTI_mem_finalize(ABTI_global *p_global)
Definition: malloc.c:192
ABTU_roundup_uint64
static uint64_t ABTU_roundup_uint64(uint64_t val, uint64_t multiple)
Definition: abtu.h:85
ABTI_ASSERT
#define ABTI_ASSERT(cond)
Definition: abti_error.h:12
ABTI_mem_alloc_ythread_mempool_desc
static ABTU_ret_err int ABTI_mem_alloc_ythread_mempool_desc(ABTI_local *p_local, ABTI_thread_attr *p_attr, ABTI_ythread **pp_ythread)
Definition: abti_mem.h:256
ABT_CONFIG_STATIC_CACHELINE_SIZE
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
Definition: abt_config.h:72
ABTI_STATIC_ASSERT
#define ABTI_STATIC_ASSERT(cond)
Definition: abti_error.h:19
ABT_SUCCESS
#define ABT_SUCCESS
Error code: the routine returns successfully.
Definition: abt.h:92
ABTU_ret_err
#define ABTU_ret_err
Definition: abtu.h:146
ABTI_thread_attr::stacksize
size_t stacksize
Definition: abti.h:390
ABTI_local_get_xstream_or_null
static ABTI_xstream * ABTI_local_get_xstream_or_null(ABTI_local *p_local)
Definition: abti_local.h:77
ABTI_mem_init_local
ABTU_ret_err int ABTI_mem_init_local(ABTI_global *p_global, ABTI_xstream *p_local_xstream)
Definition: malloc.c:186
ABTI_IS_EXT_THREAD_ENABLED
#define ABTI_IS_EXT_THREAD_ENABLED
Definition: abti.h:28
ABTI_STACK_CANARY_VALUE
#define ABTI_STACK_CANARY_VALUE
Definition: abti_mem.h:32
ABTI_mem_alloc_nythread_malloc
static ABTU_ret_err int ABTI_mem_alloc_nythread_malloc(ABTI_thread **pp_thread)
Definition: abti_mem.h:67
ABTI_ythread
Definition: abti.h:406
ABTU_free
static void ABTU_free(void *ptr)
Definition: abtu.h:217
ABTD_spinlock_release
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
Definition: abtd_spinlock.h:42
ABTI_thread_attr::p_stack
void * p_stack
Definition: abti.h:389
ABTI_ythread::p_stack
void * p_stack
Definition: abti.h:409
ABTI_ythread::thread
ABTI_thread thread
Definition: abti.h:407
ABTI_local
struct ABTI_local ABTI_local
Definition: abti.h:110
ABTI_VALGRIND_UNREGISTER_STACK
#define ABTI_VALGRIND_UNREGISTER_STACK(p_stack)
Definition: abti_valgrind.h:35
ABT_CONFIG_STACK_CHECK_CANARY_SIZE
#define ABT_CONFIG_STACK_CHECK_CANARY_SIZE
Definition: abt_config.h:66
ABTI_mem_alloc_ythread_malloc_desc_stack
static ABTU_ret_err int ABTI_mem_alloc_ythread_malloc_desc_stack(ABTI_thread_attr *p_attr, ABTI_ythread **pp_ythread)
Definition: abti_mem.h:236
ABTI_global
Definition: abti.h:196
ABTI_mem_pool_free
static void ABTI_mem_pool_free(ABTI_mem_pool_local_pool *p_local_pool, void *mem)
Definition: abti_mem_pool.h:162
ABTI_mem_check_lp_alloc
int ABTI_mem_check_lp_alloc(ABTI_global *p_global, int lp_alloc)
ABTI_mem_free_desc
static void ABTI_mem_free_desc(ABTI_global *p_global, ABTI_local *p_local, void *p_desc)
Definition: abti_mem.h:358
ABTI_mem_finalize_local
void ABTI_mem_finalize_local(ABTI_xstream *p_local_xstream)
Definition: malloc.c:196
ABTI_MEM_POOL_DESC_ELEM_SIZE
#define ABTI_MEM_POOL_DESC_ELEM_SIZE
Definition: abti_mem.h:14
ABTI_MEM_LP_MMAP_RP
@ ABTI_MEM_LP_MMAP_RP
Definition: abti_mem.h:19
ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK
#define ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK
Definition: abti.h:93
ABTI_THREAD_TYPE_MEM_MALLOC_DESC
#define ABTI_THREAD_TYPE_MEM_MALLOC_DESC
Definition: abti.h:91
ABTI_mem_alloc_ythread_default
static ABTU_ret_err int ABTI_mem_alloc_ythread_default(ABTI_global *p_global, ABTI_local *p_local, ABTI_ythread **pp_ythread)
Definition: abti_mem.h:168