Lines Matching refs:proto

58 #define nxt_lvlhsh_level_size(proto, nlvl)                                    \  argument
59 ((uintptr_t) 1 << proto->shift[nlvl])
74 #define nxt_lvlhsh_bucket_size(proto) \ argument
75 proto->bucket_size
78 #define nxt_lvlhsh_bucket(proto, bkt) \ argument
79 (uint32_t *) ((uintptr_t) bkt & ~(uintptr_t) proto->bucket_mask)
82 #define nxt_lvlhsh_bucket_entries(proto, bkt) \ argument
83 (((uintptr_t) bkt & (uintptr_t) proto->bucket_mask) >> 1)
86 #define nxt_lvlhsh_bucket_end(proto, bkt) \ argument
87 &bkt[proto->bucket_end]
94 #define nxt_lvlhsh_next_bucket(proto, bkt) \ argument
95 ((void **) &bkt[proto->bucket_end])
147 const nxt_lvlhsh_proto_t *proto; member
208 shift = lhq->proto->shift[nlvl]; in nxt_lvlhsh_level_find()
235 bucket = nxt_lvlhsh_bucket(lhq->proto, bkt); in nxt_lvlhsh_bucket_find()
236 n = nxt_lvlhsh_bucket_entries(lhq->proto, bkt); in nxt_lvlhsh_bucket_find()
247 if (lhq->proto->test(lhq, value) == NXT_OK) { in nxt_lvlhsh_bucket_find()
259 bkt = *nxt_lvlhsh_next_bucket(lhq->proto, bucket); in nxt_lvlhsh_bucket_find()
292 bucket = lhq->proto->alloc(lhq->pool, nxt_lvlhsh_bucket_size(lhq->proto)); in nxt_lvlhsh_new_bucket()
299 *nxt_lvlhsh_next_bucket(lhq->proto, bucket) = NULL; in nxt_lvlhsh_new_bucket()
319 shift = lhq->proto->shift[nlvl]; in nxt_lvlhsh_level_insert()
354 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_bucket_insert() local
359 proto = lhq->proto; in nxt_lvlhsh_bucket_insert()
364 bucket = nxt_lvlhsh_bucket(proto, *bkt); in nxt_lvlhsh_bucket_insert()
365 n = nxt_lvlhsh_bucket_entries(proto, *bkt); in nxt_lvlhsh_bucket_insert()
375 if (proto->test(lhq, value) == NXT_OK) { in nxt_lvlhsh_bucket_insert()
407 if (e < nxt_lvlhsh_bucket_end(proto, bucket)) { in nxt_lvlhsh_bucket_insert()
418 bkt = nxt_lvlhsh_next_bucket(proto, bucket); in nxt_lvlhsh_bucket_insert()
434 if (nxt_fast_path(proto->shift[nlvl] != 0)) { in nxt_lvlhsh_bucket_insert()
460 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_convert_bucket_to_level() local
462 proto = lhq->proto; in nxt_lvlhsh_convert_bucket_to_level()
463 size = nxt_lvlhsh_level_size(proto, nlvl); in nxt_lvlhsh_convert_bucket_to_level()
465 lvl = proto->alloc(lhq->pool, size * (sizeof(void *))); in nxt_lvlhsh_convert_bucket_to_level()
483 shift += proto->shift[i]; in nxt_lvlhsh_convert_bucket_to_level()
486 end = nxt_lvlhsh_bucket_end(proto, bucket); in nxt_lvlhsh_convert_bucket_to_level()
490 q.proto = proto; in nxt_lvlhsh_convert_bucket_to_level()
505 proto->free(lhq->pool, bucket); in nxt_lvlhsh_convert_bucket_to_level()
520 shift = lhq->proto->shift[nlvl]; in nxt_lvlhsh_level_convertion_insert()
557 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_bucket_convertion_insert() local
560 proto = lhq->proto; in nxt_lvlhsh_bucket_convertion_insert()
563 bucket = nxt_lvlhsh_bucket(proto, *bkt); in nxt_lvlhsh_bucket_convertion_insert()
564 n = nxt_lvlhsh_bucket_entries(proto, *bkt); in nxt_lvlhsh_bucket_convertion_insert()
567 if (nxt_fast_path(e < nxt_lvlhsh_bucket_end(proto, bucket))) { in nxt_lvlhsh_bucket_convertion_insert()
576 bkt = nxt_lvlhsh_next_bucket(proto, bucket); in nxt_lvlhsh_bucket_convertion_insert()
584 if (nxt_fast_path(proto->shift[nlvl] != 0)) { in nxt_lvlhsh_bucket_convertion_insert()
605 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_free_level() local
607 proto = lhq->proto; in nxt_lvlhsh_free_level()
617 proto->free(lhq->pool, nxt_lvlhsh_bucket(proto, level[i])); in nxt_lvlhsh_free_level()
621 proto->free(lhq->pool, level); in nxt_lvlhsh_free_level()
652 shift = lhq->proto->shift[nlvl]; in nxt_lvlhsh_level_delete()
673 lhq->proto->free(lhq->pool, lvl); in nxt_lvlhsh_level_delete()
690 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_bucket_delete() local
692 proto = lhq->proto; in nxt_lvlhsh_bucket_delete()
695 bucket = nxt_lvlhsh_bucket(proto, *bkt); in nxt_lvlhsh_bucket_delete()
696 n = nxt_lvlhsh_bucket_entries(proto, *bkt); in nxt_lvlhsh_bucket_delete()
706 if (proto->test(lhq, value) == NXT_OK) { in nxt_lvlhsh_bucket_delete()
708 if (nxt_lvlhsh_bucket_entries(proto, *bkt) == 1) { in nxt_lvlhsh_bucket_delete()
709 *bkt = *nxt_lvlhsh_next_bucket(proto, bucket); in nxt_lvlhsh_bucket_delete()
710 proto->free(lhq->pool, bucket); in nxt_lvlhsh_bucket_delete()
730 bkt = nxt_lvlhsh_next_bucket(proto, bucket); in nxt_lvlhsh_bucket_delete()
766 lhe->bucket = nxt_lvlhsh_bucket(lhe->proto, slot); in nxt_lvlhsh_each()
767 lhe->entries = nxt_lvlhsh_bucket_entries(lhe->proto, slot); in nxt_lvlhsh_each()
788 level_shift = lhe->proto->shift[nlvl]; in nxt_lvlhsh_level_each()
802 lhe->bucket = nxt_lvlhsh_bucket(lhe->proto, slot); in nxt_lvlhsh_level_each()
803 lhe->entries = nxt_lvlhsh_bucket_entries(lhe->proto, slot); in nxt_lvlhsh_level_each()
848 next = *nxt_lvlhsh_next_bucket(lhe->proto, lhe->bucket); in nxt_lvlhsh_bucket_each()
851 : nxt_lvlhsh_bucket(lhe->proto, next); in nxt_lvlhsh_bucket_each()
853 lhe->entries = nxt_lvlhsh_bucket_entries(lhe->proto, next); in nxt_lvlhsh_bucket_each()
862 nxt_lvlhsh_peek(nxt_lvlhsh_t *lh, const nxt_lvlhsh_proto_t *proto) in nxt_lvlhsh_peek() argument
871 peek.proto = proto; in nxt_lvlhsh_peek()
892 shift = peek->proto->shift[nlvl]; in nxt_lvlhsh_level_peek()
922 peek->proto->free(peek->pool, level); in nxt_lvlhsh_level_peek()
939 const nxt_lvlhsh_proto_t *proto; in nxt_lvlhsh_bucket_peek() local
941 bucket = nxt_lvlhsh_bucket(peek->proto, *bkt); in nxt_lvlhsh_bucket_peek()
955 proto = peek->proto; in nxt_lvlhsh_bucket_peek()
957 if (nxt_lvlhsh_bucket_entries(proto, *bkt) == 1) { in nxt_lvlhsh_bucket_peek()
958 *bkt = *nxt_lvlhsh_next_bucket(proto, bucket); in nxt_lvlhsh_bucket_peek()
959 proto->free(peek->pool, bucket); in nxt_lvlhsh_bucket_peek()
972 nxt_lvlhsh_retrieve(nxt_lvlhsh_t *lh, const nxt_lvlhsh_proto_t *proto, in nxt_lvlhsh_retrieve() argument
982 peek.proto = proto; in nxt_lvlhsh_retrieve()