|
|
|
@ -498,24 +498,26 @@ leave:
|
|
|
|
|
return cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void *
|
|
|
|
|
static inline const void *
|
|
|
|
|
ck_hs_marshal(unsigned int mode, const void *key, unsigned long h)
|
|
|
|
|
{
|
|
|
|
|
void *insert;
|
|
|
|
|
|
|
|
|
|
#ifdef CK_HS_PP
|
|
|
|
|
const void *insert;
|
|
|
|
|
|
|
|
|
|
if (mode & CK_HS_MODE_OBJECT) {
|
|
|
|
|
insert = (void *)((uintptr_t)CK_HS_VMA(key) | ((h >> 25) << CK_MD_VMA_BITS));
|
|
|
|
|
insert = (void *)((uintptr_t)CK_HS_VMA(key) |
|
|
|
|
|
((h >> 25) << CK_MD_VMA_BITS));
|
|
|
|
|
} else {
|
|
|
|
|
insert = (void *)key;
|
|
|
|
|
insert = key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insert;
|
|
|
|
|
#else
|
|
|
|
|
(void)mode;
|
|
|
|
|
(void)h;
|
|
|
|
|
insert = (void *)key;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return insert;
|
|
|
|
|
return key;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
@ -570,7 +572,7 @@ ck_hs_gc(struct ck_hs *hs, unsigned long cycles, unsigned long seed)
|
|
|
|
|
ck_hs_map_bound_get(map, h), CK_HS_PROBE);
|
|
|
|
|
|
|
|
|
|
if (first != NULL) {
|
|
|
|
|
void *insert = ck_hs_marshal(hs->mode, entry, h);
|
|
|
|
|
const void *insert = ck_hs_marshal(hs->mode, entry, h);
|
|
|
|
|
|
|
|
|
|
ck_pr_store_ptr(first, insert);
|
|
|
|
|
ck_pr_inc_uint(&map->generation[h & CK_HS_G_MASK]);
|
|
|
|
@ -614,7 +616,8 @@ ck_hs_fas(struct ck_hs *hs,
|
|
|
|
|
const void *key,
|
|
|
|
|
void **previous)
|
|
|
|
|
{
|
|
|
|
|
void **slot, **first, *object, *insert;
|
|
|
|
|
const void *insert;
|
|
|
|
|
void **slot, **first, *object;
|
|
|
|
|
unsigned long n_probes;
|
|
|
|
|
struct ck_hs_map *map = hs->map;
|
|
|
|
|
|
|
|
|
@ -660,7 +663,8 @@ ck_hs_apply(struct ck_hs *hs,
|
|
|
|
|
ck_hs_apply_fn_t *fn,
|
|
|
|
|
void *cl)
|
|
|
|
|
{
|
|
|
|
|
void **slot, **first, *object, *insert, *delta;
|
|
|
|
|
const void *insert;
|
|
|
|
|
void **slot, **first, *object, *delta;
|
|
|
|
|
unsigned long n_probes;
|
|
|
|
|
struct ck_hs_map *map;
|
|
|
|
|
|
|
|
|
@ -731,7 +735,8 @@ ck_hs_set(struct ck_hs *hs,
|
|
|
|
|
const void *key,
|
|
|
|
|
void **previous)
|
|
|
|
|
{
|
|
|
|
|
void **slot, **first, *object, *insert;
|
|
|
|
|
const void *insert;
|
|
|
|
|
void **slot, **first, *object;
|
|
|
|
|
unsigned long n_probes;
|
|
|
|
|
struct ck_hs_map *map;
|
|
|
|
|
|
|
|
|
@ -788,7 +793,8 @@ ck_hs_put_internal(struct ck_hs *hs,
|
|
|
|
|
const void *key,
|
|
|
|
|
enum ck_hs_probe_behavior behavior)
|
|
|
|
|
{
|
|
|
|
|
void **slot, **first, *object, *insert;
|
|
|
|
|
const void *insert;
|
|
|
|
|
void **slot, **first, *object;
|
|
|
|
|
unsigned long n_probes;
|
|
|
|
|
struct ck_hs_map *map;
|
|
|
|
|
|
|
|
|
|