 |
NVMLib
very early alpha
A library to optimally use a Hybrid RAM setup.
|
Go to the documentation of this file.
16 #define LIB_TOID_NULL(t) ((LIB_TOID(t))MEMOID_NULL)
19 #define LIB_TOID_ASSIGN(o, value)(\
26 #define LIB_TOID_EQUALS(lhs, rhs)\
27 (get_MEMoid((lhs).oid).off == get_MEMoid((rhs).oid).off &&\
28 get_MEMoid((lhs).oid).pool_uuid_lo == get_MEMoid((rhs).oid).pool_uuid_lo)
32 #define _lib_toid_struct
33 #define _lib_toid_union
34 #define _lib_toid_enum
44 union _lib_toid_##t##_toid
55 #define LIB_TOID_DECLARE(t)\
56 typedef uint8_t _lib_toid_##t##_toid_type_num[__COUNTER__ + 1];\
61 _lib_toid_##t##_toid_type_num *_type_num;\
65 #define LIB_TOID_TYPE_NUM(t) (sizeof(_lib_toid_##t##_toid_type_num) - 1)
69 #define LIB_TOID_TYPE_NUM_OF(o) (sizeof(*(o)._type_num) - 1)
73 #define LIB_TOID_IS_NULL(o) (get_MEMoid((o).oidkey).off == 0)
76 #define LIB_TOID_TYPEOF(o) __typeof__(*(o)._type)
79 #define LIB_DIRECT_RW(o) (\
80 {__typeof__(o) _o; _o._type = NULL; (void)_o;\
81 (__typeof__(*(o)._type) *)get_memobj_direct(get_MEMoid((o).oidkey)); })
84 #define LIB_DIRECT_RO(o) (\
85 {__typeof__(o) _o; _o._type = NULL; (void)_o;\
86 (const __typeof__(*(o)._type) *)get_memobj_direct(get_MEMoid((o).oidkey)); })
97 #define LIB_D_RW LIB_DIRECT_RW
105 #define LIB_D_RO LIB_DIRECT_RO
128 #endif // ! __NVM_TYPES__
TOID(struct hashmap_tx) *get_types_map()
void remove_object_from_hashmap(MEMoidKey key)
MEMoid get_MEMoid(MEMoidKey key)
The function to obtain the MEMoid object given the MEMoidKey
The struct that stores the memptr for the object.
uint64_t MEMoidKey
The key of the HashTable that contains <MEMoidKey, MEMoid>.
void insert_object_to_hashmap(MEMoidKey key, MEMoid oid)
void debug_hashmap(MEMoidKey key)