Lines Matching refs:Key
22 typedef uint64_t Key; typedef
28 static Key Decode(const char* key) { in Decode()
29 Key rv; in Decode()
30 memcpy(&rv, key, sizeof(Key)); in Decode()
35 typedef Key DecodedType;
66 void Insert(TestInlineSkipList* list, Key key) { in Insert()
67 char* buf = list->AllocateKey(sizeof(Key)); in Insert()
68 memcpy(buf, &key, sizeof(Key)); in Insert()
73 bool InsertWithHint(TestInlineSkipList* list, Key key, void** hint) { in InsertWithHint()
74 char* buf = list->AllocateKey(sizeof(Key)); in InsertWithHint()
75 memcpy(buf, &key, sizeof(Key)); in InsertWithHint()
83 for (Key key : keys_) { in Validate()
90 Key zero = 0; in Validate()
92 for (Key key : keys_) { in Validate()
103 std::set<Key> keys_;
110 Key key = 10; in TEST_F()
130 std::set<Key> keys; in TEST_F()
135 Key key = rnd.Next() % R; in TEST_F()
137 char* buf = list.AllocateKey(sizeof(Key)); in TEST_F()
138 memcpy(buf, &key, sizeof(Key)); in TEST_F()
143 for (Key i = 0; i < R; i++) { in TEST_F()
176 for (Key i = 0; i < R; i++) { in TEST_F()
181 std::set<Key>::iterator model_iter = keys.lower_bound(i); in TEST_F()
196 for (Key i = 0; i < R; i++) { in TEST_F()
201 std::set<Key>::iterator model_iter = keys.upper_bound(i); in TEST_F()
222 Key key = i; in TEST_F()
236 Key last_key[S]; in TEST_F()
242 Key s = rnd.Uniform(S); in TEST_F()
243 Key key = (s << 32) + (++last_key[s]); in TEST_F()
261 Key s = rnd.Uniform(S); in TEST_F()
262 Key key = (s << 32) + rnd.Next(); in TEST_F()
276 std::unordered_set<Key> used; in TEST_F()
277 Key with_hint[S1]; in TEST_F()
278 Key without_hint[S2]; in TEST_F()
283 Key s = rnd.Next(); in TEST_F()
292 Key s = rnd.Next(); in TEST_F()
300 Key s = rnd.Uniform(S1 + S2); in TEST_F()
302 Key key = (with_hint[s] << 32) + rnd.Next(); in TEST_F()
305 Key key = (without_hint[s - S1] << 32) + rnd.Next(); in TEST_F()
342 static uint64_t key(Key key) { return (key >> 40); } in key()
343 static uint64_t gen(Key key) { return (key >> 8) & 0xffffffffu; } in gen()
344 static uint64_t hash(Key key) { return key & 0xff; } in hash()
351 static Key MakeKey(uint64_t k, uint64_t g) { in MakeKey()
352 assert(sizeof(Key) == sizeof(uint64_t)); in MakeKey()
358 static bool IsValidKey(Key k) { in IsValidKey()
362 static Key RandomTarget(Random* rnd) { in RandomTarget()
407 const Key new_key = MakeKey(k, g); in WriteStep()
408 char* buf = list_.AllocateKey(sizeof(Key)); in WriteStep()
409 memcpy(buf, &new_key, sizeof(Key)); in WriteStep()
417 const Key new_key = MakeKey(k, g); in ConcurrentWriteStep()
418 char* buf = list_.AllocateKey(sizeof(Key)); in ConcurrentWriteStep()
419 memcpy(buf, &new_key, sizeof(Key)); in ConcurrentWriteStep()
438 Key pos = RandomTarget(rnd); in ReadStep()
442 Key current; in ReadStep()
480 Key new_target = RandomTarget(rnd); in ReadStep()