ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
6 #ifndef ABTI_KEY_H_INCLUDED
7 #define ABTI_KEY_H_INCLUDED
13 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
28 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
42 #define ABTI_KEY_STATIC_INITIALIZER(f_destructor, id) \
47 #define ABTI_KEY_ID_STACKABLE_SCHED 0
48 #define ABTI_KEY_ID_MIGRATION 1
49 #define ABTI_KEY_ID_END_ 2
56 #define ABTI_KTABLE_DESC_SIZE \
57 (ABTI_MEM_POOL_DESC_SIZE - sizeof(ABTI_ktable_mem_header))
59 #define ABTI_KTABLE_LOCKED ((ABTI_ktable *)0x1)
63 return (((uintptr_t)(
void *)p_ktable) & (~((uintptr_t)(
void *)0x1))) !=
64 ((uintptr_t)(
void *)0x0);
74 ABTI_ASSERT((key_table_size & (key_table_size - 1)) == 0);
94 p_ktable->
p_extra_mem = (
void *)(((
char *)p_ktable) + ktable_size);
111 p_ktable->
size = key_table_size;
114 *pp_ktable = p_ktable;
125 if (size <= extra_mem_size) {
128 p_ktable->
p_extra_mem = (
void *)(((
char *)p_mem) + size);
142 p_ktable->
p_extra_mem = (
void *)(((
char *)p_mem) + size);
164 return p_key->
id & (size - 1);
177 pp_elem = &p_ktable->
p_elems[idx];
179 uint32_t key_id = p_key->
id;
181 if (p_elem->
key_id == key_id) {
182 p_elem->
value = value;
185 pp_elem = &p_elem->
p_next;
195 if (p_elem->
key_id == key_id) {
198 p_elem->
value = value;
201 pp_elem = &p_elem->
p_next;
216 p_elem->key_id = p_key->
id;
217 p_elem->value = value;
251 if (p_ktable == NULL) {
279 *pp_ktable = p_ktable;
297 uint32_t key_id = p_key->
id;
299 if (p_elem->
key_id == key_id) {
300 return p_elem->
value;
struct ABT_key_opaque * ABT_key
Work-unit-specific data key handle type.
int ABT_bool
Boolean type.
static void * ABTI_ktable_get(ABTD_atomic_ptr *pp_ktable, ABTI_key *p_key)
static ABTI_key * ABTI_key_get_ptr(ABT_key key)
static size_t ABTU_roundup_size(size_t val, size_t multiple)
#define ABTI_CHECK_ERROR(abt_errno)
static ABTU_ret_err int ABTI_mem_alloc_desc(ABTI_local *p_local, void **pp_desc)
#define ABTI_IS_ERROR_CHECK_ENABLED
static ABTU_ret_err int ABTI_ktable_create(ABTI_global *p_global, ABTI_local *p_local, ABTI_ktable **pp_ktable)
#define ABTU_likely(cond)
static ABTU_ret_err int ABTI_ktable_set(ABTI_global *p_global, ABTI_local *p_local, ABTD_atomic_ptr *pp_ktable, ABTI_key *p_key, void *value)
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
#define ABTI_HANDLE_ERROR(n)
static void ABTD_atomic_pause(void)
static ABTU_ret_err int ABTI_ktable_alloc_elem(ABTI_local *p_local, ABTI_ktable *p_ktable, size_t size, void **pp_mem)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
#define ABTI_KTABLE_DESC_SIZE
static int ABTI_ktable_is_valid(ABTI_ktable *p_ktable)
struct ABTI_ktable_mem_header ABTI_ktable_mem_header
#define ABTI_ASSERT(cond)
static void ABTD_atomic_release_store_ptr(ABTD_atomic_ptr *ptr, void *val)
#define ABTI_STATIC_ASSERT(cond)
static ABTU_ret_err int ABTI_ktable_set_unsafe(ABTI_global *p_global, ABTI_local *p_local, ABTI_ktable **pp_ktable, ABTI_key *p_key, void *value)
#define ABT_SUCCESS
Error code: the routine returns successfully.
static int ABTD_atomic_bool_cas_weak_ptr(ABTD_atomic_ptr *ptr, void *oldv, void *newv)
static ABT_key ABTI_key_get_handle(ABTI_key *p_key)
#define ABTU_unlikely(cond)
#define ABT_TRUE
True constant for ABT_bool.
#define ABTU_MAX_ALIGNMENT
struct ABTI_ktelem ABTI_ktelem
static void ABTD_spinlock_clear(ABTD_spinlock *p_lock)
#define ABTI_KTABLE_LOCKED
#define ABT_FALSE
False constant for ABT_bool.
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
static ABTU_ret_err int ABTI_ktable_set_impl(ABTI_local *p_local, ABTI_ktable *p_ktable, ABTI_key *p_key, void *value, ABT_bool is_safe)
struct ABTI_local ABTI_local
static void * ABTD_atomic_acquire_load_ptr(const ABTD_atomic_ptr *ptr)
ABTD_atomic_ptr p_elems[1]
static uint32_t ABTI_ktable_get_idx(ABTI_key *p_key, int size)
static void ABTD_atomic_relaxed_store_ptr(ABTD_atomic_ptr *ptr, void *val)
void(* f_destructor)(void *value)