 |
NVMLib
very early alpha
A library to optimally use a Hybrid RAM setup.
|
Go to the documentation of this file. 1 #ifndef __NVM_HASHMAP_TX_H
2 #define __NVM_HASHMAP_TX_H
6 #include <libpmemobj.h>
18 #ifndef HASHMAP_TX_TYPE_OFFSET
19 #define HASHMAP_TX_TYPE_OFFSET 1004
81 #endif // !__NVM_HASHMAP_TX_H
MEMoid hm_tx_remove(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key)
Removes specified value from the hashmap.
POBJ_LAYOUT_BEGIN(types_tab)
int hm_tx_check(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap)
Checks if specified persistent object is an instance of hashmap.
TOID(struct buckets) buckets
struct hashmap_tx hashmap_tx
The struct that stores the memptr for the object.
void hm_tx_debug(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, FILE *out)
Prints complete hashmap state.
int hm_tx_cmd(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, unsigned cmd, uint64_t arg)
Executes a command for hashmap.
POBJ_LAYOUT_TOID(types_tab, struct buckets)
POBJ_LAYOUT_END(types_tab)
size_t hm_tx_count(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap)
Returns number of elements in the hashmap.
MEMoid hm_tx_get(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key)
Checks whether specified key is in the hashmap and retries the value associated with it.
TOID(struct entry) bucket[]
int hm_tx_create(PMEMobjpool *pop, TOID(struct hashmap_tx) *map, void *arg)
Allocates a new hashmap.
int hm_tx_lookup(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key)
Checks whether specified key exists in the hashmap.
int hm_tx_init(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap)
Recovers hashmap state.
POBJ_LAYOUT_ROOT(types_tab, struct hashmap_tx)
int hm_tx_foreach(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, int(*cb)(uint64_t key, MEMoid value, void *arg), void *arg)
Calls a given callback for every element in the hashmap.
int hm_tx_insert(PMEMobjpool *pop, TOID(struct hashmap_tx) hashmap, uint64_t key, MEMoid value)
Inserts the specified value into the hashmap.