| 1 |
|
| MODULE = Data::HashMap PACKAGE = Data::HashMap::I32A |
| 2 |
|
| PROTOTYPES: DISABLE |
| 3 |
|
| |
| 4 |
|
| SV* |
| 5 |
|
| new(SV* class, ...) |
| 6 |
|
| CODE: |
| 7 |
31 |
▶ | EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
1 |
30 |
31 |
| EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
14 |
16 |
30 |
| EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
10 |
20 |
30 |
| EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
8 |
22 |
30 |
| EXTRACT_NEW_ARGS_SV(_max_size, _ttl, _lru_skip); |
8 |
0 |
8 |
|
| 8 |
30 |
| HashMapI32A* map = hashmap_i32a_create(_max_size, _ttl, _lru_skip); |
| 9 |
30 |
▶ | if (!map) croak("Failed to create HashMap::I32A"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!map) croak("Failed to create HashMap::I32A"); |
0 |
30 |
30 |
|
| 10 |
30 |
| map->free_value_fn = hm_sv_free; |
| 11 |
30 |
| map->free_value_now_fn = hm_sv_free_now; |
| 12 |
30 |
▶ | map->copy_values = items > 4 && SvTRUE(ST(4)); |
Branch: 2 branches
| Branch | True | False | Total |
| map->copy_values = items > 4 && SvTRUE(ST(4)); |
8 |
22 |
30 |
| map->copy_values = items > 4 && SvTRUE(ST(4)); |
7 |
1 |
8 |
|
| 13 |
30 |
| RETVAL = sv_setref_pv(newSV(0), hm_class_name(aTHX_ class), (void*)map); |
| 14 |
|
| OUTPUT: |
| 15 |
|
| RETVAL |
| 16 |
|
| |
| 17 |
|
| void |
| 18 |
|
| DESTROY(SV* self_sv) |
| 19 |
|
| CODE: |
| 20 |
34 |
▶ | HM_DESTROY(HashMapI32A, hashmap_i32a_destroy, self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| HM_DESTROY(HashMapI32A, hashmap_i32a_destroy, self_sv); |
0 |
34 |
34 |
| HM_DESTROY(HashMapI32A, hashmap_i32a_destroy, self_sv); |
0 |
34 |
34 |
|
| 21 |
|
| |
| 22 |
|
| bool |
| 23 |
|
| put(SV* self_sv, int32_t key, SV* value) |
| 24 |
|
| CODE: |
| 25 |
50576 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50576 |
0 |
50576 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50576 |
0 |
50576 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50576 |
50576 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50576 |
50576 |
|
| 26 |
50576 |
▶ | value = HM_STORE_SV(self, value, newSVsv(value)); |
Branch: 1 branch
| Branch | True | False | Total |
| value = HM_STORE_SV(self, value, newSVsv(value)); |
304 |
50272 |
50576 |
|
| 27 |
50576 |
| RETVAL = hashmap_i32a_put(self, key, (void*)value, 0); |
| 28 |
50576 |
▶ | if (!RETVAL) SvREFCNT_dec(value); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!RETVAL) SvREFCNT_dec(value); |
2 |
50574 |
50576 |
|
| 29 |
|
| OUTPUT: |
| 30 |
|
| RETVAL |
| 31 |
|
| |
| 32 |
|
| SV* |
| 33 |
|
| get(SV* self_sv, int32_t key) |
| 34 |
|
| CODE: |
| 35 |
50041 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50041 |
0 |
50041 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50041 |
0 |
50041 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50041 |
50041 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50041 |
50041 |
|
| 36 |
|
| void* val; |
| 37 |
50041 |
▶ | if (!hashmap_i32a_get(self, key, &val)) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_get(self, key, &val)) XSRETURN_UNDEF; |
4 |
50037 |
50041 |
|
| 38 |
50037 |
| RETVAL = SvREFCNT_inc((SV*)val); |
| 39 |
|
| OUTPUT: |
| 40 |
|
| RETVAL |
| 41 |
|
| |
| 42 |
|
| bool |
| 43 |
|
| remove(SV* self_sv, int32_t key) |
| 44 |
|
| CODE: |
| 45 |
50007 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50007 |
0 |
50007 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
50007 |
0 |
50007 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50007 |
50007 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
50007 |
50007 |
|
| 46 |
50007 |
| RETVAL = hashmap_i32a_remove(self, key); |
| 47 |
|
| OUTPUT: |
| 48 |
|
| RETVAL |
| 49 |
|
| |
| 50 |
|
| SV* |
| 51 |
|
| take(SV* self_sv, int32_t key) |
| 52 |
|
| CODE: |
| 53 |
1 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
1 |
0 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
1 |
0 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
1 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
1 |
1 |
|
| 54 |
|
| void* val; |
| 55 |
1 |
▶ | if (!hashmap_i32a_take(self, key, &val)) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_take(self, key, &val)) XSRETURN_UNDEF; |
0 |
1 |
1 |
|
| 56 |
1 |
| RETVAL = (SV*)val; |
| 57 |
|
| OUTPUT: |
| 58 |
|
| RETVAL |
| 59 |
|
| |
| 60 |
|
| bool |
| 61 |
|
| exists(SV* self_sv, int32_t key) |
| 62 |
|
| CODE: |
| 63 |
4833 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4833 |
0 |
4833 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4833 |
0 |
4833 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4833 |
4833 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4833 |
4833 |
|
| 64 |
4833 |
| RETVAL = hashmap_i32a_exists(self, key); |
| 65 |
|
| OUTPUT: |
| 66 |
|
| RETVAL |
| 67 |
|
| |
| 68 |
|
| size_t |
| 69 |
|
| size(SV* self_sv) |
| 70 |
|
| CODE: |
| 71 |
12 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
12 |
0 |
12 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
12 |
0 |
12 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
12 |
12 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
12 |
12 |
|
| 72 |
12 |
▶ | RETVAL = self->size; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = self->size; |
3 |
9 |
12 |
|
| 73 |
|
| OUTPUT: |
| 74 |
|
| RETVAL |
| 75 |
|
| |
| 76 |
|
| size_t |
| 77 |
|
| max_size(SV* self_sv) |
| 78 |
|
| CODE: |
| 79 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 80 |
0 |
▶ | RETVAL = self->max_size; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = self->max_size; |
0 |
0 |
0 |
|
| 81 |
|
| OUTPUT: |
| 82 |
|
| RETVAL |
| 83 |
|
| |
| 84 |
|
| UV |
| 85 |
|
| ttl(SV* self_sv) |
| 86 |
|
| CODE: |
| 87 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 88 |
0 |
▶ | RETVAL = (UV)self->default_ttl; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)self->default_ttl; |
0 |
0 |
0 |
|
| 89 |
|
| OUTPUT: |
| 90 |
|
| RETVAL |
| 91 |
|
| |
| 92 |
|
| UV |
| 93 |
|
| lru_skip(SV* self_sv) |
| 94 |
|
| CODE: |
| 95 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 96 |
0 |
▶ | RETVAL = (UV)self->lru_skip; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)self->lru_skip; |
0 |
0 |
0 |
|
| 97 |
|
| OUTPUT: |
| 98 |
|
| RETVAL |
| 99 |
|
| |
| 100 |
|
| void |
| 101 |
|
| keys(SV* self_sv) |
| 102 |
|
| PPCODE: |
| 103 |
141 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
141 |
0 |
141 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
141 |
0 |
141 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
141 |
141 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
141 |
141 |
|
| 104 |
141 |
▶ | if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
Branch: 2 branches
| Branch | True | False | Total |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
141 |
141 |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
0 |
0 |
|
| 105 |
141 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
141 |
141 |
|
| 106 |
141 |
▶ | EXTEND(SP, self->size); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, self->size); |
0 |
141 |
141 |
|
| 107 |
|
| size_t i; |
| 108 |
18077 |
▶ | for (i = 0; i < self->capacity; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; i < self->capacity; i++) { |
17936 |
141 |
18077 |
|
| 109 |
17936 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
4832 |
13104 |
17936 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
4832 |
0 |
4832 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
0 |
4832 |
4832 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) |
0 |
0 |
0 |
|
| 110 |
4832 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
4832 |
4832 |
|
| 111 |
|
| } |
| 112 |
|
| |
| 113 |
|
| void |
| 114 |
|
| values(SV* self_sv) |
| 115 |
|
| PPCODE: |
| 116 |
3 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
3 |
0 |
3 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
3 |
0 |
3 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
3 |
3 |
|
| 117 |
3 |
▶ | if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
Branch: 2 branches
| Branch | True | False | Total |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
3 |
3 |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
0 |
0 |
|
| 118 |
3 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
2 |
1 |
3 |
|
| 119 |
3 |
▶ | EXTEND(SP, self->size); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, self->size); |
0 |
3 |
3 |
|
| 120 |
|
| size_t i; |
| 121 |
51 |
▶ | for (i = 0; i < self->capacity; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; i < self->capacity; i++) { |
48 |
3 |
51 |
|
| 122 |
48 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
14 |
34 |
48 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
14 |
0 |
14 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
12 |
2 |
14 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
2 |
10 |
12 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
2 |
0 |
2 |
|
| 123 |
14 |
▶ | SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
Branch: 1 branch
| Branch | True | False | Total |
| SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
14 |
0 |
14 |
|
| 124 |
14 |
▶ | mXPUSHs(sv); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs(sv); |
0 |
14 |
14 |
|
| 125 |
|
| } |
| 126 |
|
| } |
| 127 |
|
| |
| 128 |
|
| void |
| 129 |
|
| items(SV* self_sv) |
| 130 |
|
| PPCODE: |
| 131 |
1 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
1 |
0 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
1 |
0 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
1 |
1 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
1 |
1 |
|
| 132 |
1 |
▶ | if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
Branch: 2 branches
| Branch | True | False | Total |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
1 |
1 |
| if (GIMME_V == G_SCALAR) { mXPUSHu(self->size); XSRETURN(1); } |
0 |
0 |
0 |
|
| 133 |
1 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
1 |
1 |
|
| 134 |
1 |
▶ | EXTEND(SP, self->size * 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, self->size * 2); |
0 |
1 |
1 |
|
| 135 |
|
| size_t i; |
| 136 |
17 |
▶ | for (i = 0; i < self->capacity; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; i < self->capacity; i++) { |
16 |
1 |
17 |
|
| 137 |
16 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
2 |
14 |
16 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
2 |
0 |
2 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
2 |
2 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
|
| 138 |
2 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
2 |
2 |
|
| 139 |
2 |
▶ | SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
Branch: 1 branch
| Branch | True | False | Total |
| SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
2 |
0 |
2 |
|
| 140 |
2 |
▶ | mXPUSHs(sv); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs(sv); |
0 |
2 |
2 |
|
| 141 |
|
| } |
| 142 |
|
| } |
| 143 |
|
| |
| 144 |
|
| void |
| 145 |
|
| each(SV* self_sv) |
| 146 |
|
| PPCODE: |
| 147 |
6 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
6 |
0 |
6 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
6 |
0 |
6 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
6 |
6 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
6 |
6 |
|
| 148 |
6 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
6 |
6 |
|
| 149 |
34 |
▶ | while (self->iter_pos < self->capacity) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (self->iter_pos < self->capacity) { |
32 |
2 |
34 |
|
| 150 |
32 |
| size_t i = self->iter_pos++; |
| 151 |
32 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
4 |
28 |
32 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
4 |
0 |
4 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
4 |
4 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
|
| 152 |
4 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
4 |
4 |
|
| 153 |
4 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
4 |
4 |
|
| 154 |
4 |
▶ | if (GIMME_V == G_SCALAR) XSRETURN(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if (GIMME_V == G_SCALAR) XSRETURN(1); |
0 |
4 |
4 |
|
| 155 |
4 |
▶ | SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
Branch: 1 branch
| Branch | True | False | Total |
| SV* sv = self->nodes[i].value ? SvREFCNT_inc((SV*)self->nodes[i].value) : &PL_sv_undef; |
4 |
0 |
4 |
|
| 156 |
4 |
▶ | mXPUSHs(sv); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs(sv); |
0 |
4 |
4 |
|
| 157 |
4 |
| XSRETURN(2); |
| 158 |
|
| } |
| 159 |
|
| } |
| 160 |
2 |
| self->iter_pos = 0; |
| 161 |
2 |
| XSRETURN_EMPTY; |
| 162 |
|
| |
| 163 |
|
| void |
| 164 |
|
| iter_reset(SV* self_sv) |
| 165 |
|
| CODE: |
| 166 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 167 |
0 |
| self->iter_pos = 0; |
| 168 |
|
| |
| 169 |
|
| void |
| 170 |
|
| drain(SV* self_sv, UV count) |
| 171 |
|
| PPCODE: |
| 172 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 173 |
0 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
0 |
0 |
|
| 174 |
0 |
| UV n = 0; |
| 175 |
0 |
▶ | EXTEND(SP, (count < self->size ? count : self->size) * 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, (count < self->size ? count : self->size) * 2); |
0 |
0 |
0 |
|
| 176 |
|
| size_t scanned; |
| 177 |
0 |
▶ | for (scanned = 0; scanned < self->capacity && n < count; scanned++) { |
Branch: 2 branches
| Branch | True | False | Total |
| for (scanned = 0; scanned < self->capacity && n < count; scanned++) { |
0 |
0 |
0 |
| for (scanned = 0; scanned < self->capacity && n < count; scanned++) { |
0 |
0 |
0 |
|
| 178 |
0 |
▶ | if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
0 |
0 |
0 |
|
| 179 |
0 |
| size_t i = self->drain_pos++; |
| 180 |
0 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
|
| 181 |
0 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
0 |
0 |
|
| 182 |
0 |
▶ | if (self->nodes[i].value) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->nodes[i].value) { |
0 |
0 |
0 |
|
| 183 |
0 |
▶ | mXPUSHs((SV*)self->nodes[i].value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs((SV*)self->nodes[i].value); |
0 |
0 |
0 |
|
| 184 |
0 |
▶ | } else { XPUSHs(&PL_sv_undef); } |
Branch: 1 branch
| Branch | True | False | Total |
| } else { XPUSHs(&PL_sv_undef); } |
0 |
0 |
0 |
|
| 185 |
0 |
| self->nodes[i].value = NULL; |
| 186 |
0 |
▶ | if (HM_UNLIKELY(self->lru_prev)) hashmap_i32a_lru_unlink(self, (uint32_t)i); |
Branch: 1 branch
| Branch | True | False | Total |
| if (HM_UNLIKELY(self->lru_prev)) hashmap_i32a_lru_unlink(self, (uint32_t)i); |
0 |
0 |
0 |
|
| 187 |
0 |
| hashmap_i32a_tombstone_at(self, i); |
| 188 |
0 |
| n++; |
| 189 |
|
| } |
| 190 |
|
| } |
| 191 |
0 |
▶ | if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
0 |
0 |
0 |
|
| 192 |
0 |
▶ | HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
Branch: 4 branches
| Branch | True | False | Total |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
|
| 193 |
|
| |
| 194 |
|
| void |
| 195 |
|
| pop(SV* self_sv) |
| 196 |
|
| PPCODE: |
| 197 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 198 |
0 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
0 |
0 |
|
| 199 |
0 |
▶ | if (self->lru_prev) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->lru_prev) { |
0 |
0 |
0 |
|
| 200 |
0 |
▶ | while (self->lru_tail != HM_LRU_NONE) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (self->lru_tail != HM_LRU_NONE) { |
0 |
0 |
0 |
|
| 201 |
0 |
| uint32_t idx = self->lru_tail; |
| 202 |
0 |
▶ | if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
Branch: 4 branches
| Branch | True | False | Total |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
|
| 203 |
0 |
| hashmap_i32a_expire_at(self, idx, true); continue; |
| 204 |
|
| } |
| 205 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 206 |
0 |
▶ | mXPUSHi(self->nodes[idx].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[idx].key); |
0 |
0 |
0 |
|
| 207 |
0 |
▶ | if (self->nodes[idx].value) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->nodes[idx].value) { |
0 |
0 |
0 |
|
| 208 |
0 |
▶ | mXPUSHs((SV*)self->nodes[idx].value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs((SV*)self->nodes[idx].value); |
0 |
0 |
0 |
|
| 209 |
0 |
▶ | } else { XPUSHs(&PL_sv_undef); } |
Branch: 1 branch
| Branch | True | False | Total |
| } else { XPUSHs(&PL_sv_undef); } |
0 |
0 |
0 |
|
| 210 |
0 |
| self->nodes[idx].value = NULL; |
| 211 |
0 |
| hashmap_i32a_lru_unlink(self, idx); |
| 212 |
0 |
| hashmap_i32a_tombstone_at(self, idx); |
| 213 |
0 |
▶ | HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
Branch: 4 branches
| Branch | True | False | Total |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
|
| 214 |
0 |
| XSRETURN(2); |
| 215 |
|
| } |
| 216 |
0 |
| XSRETURN_EMPTY; |
| 217 |
|
| } else { |
| 218 |
|
| size_t scanned; |
| 219 |
0 |
▶ | for (scanned = 0; scanned < self->capacity; scanned++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (scanned = 0; scanned < self->capacity; scanned++) { |
0 |
0 |
0 |
|
| 220 |
0 |
▶ | if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->drain_pos >= self->capacity) self->drain_pos = 0; |
0 |
0 |
0 |
|
| 221 |
0 |
| size_t i = self->drain_pos++; |
| 222 |
0 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
|
| 223 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 224 |
0 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
0 |
0 |
|
| 225 |
0 |
▶ | if (self->nodes[i].value) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->nodes[i].value) { |
0 |
0 |
0 |
|
| 226 |
0 |
▶ | mXPUSHs((SV*)self->nodes[i].value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs((SV*)self->nodes[i].value); |
0 |
0 |
0 |
|
| 227 |
0 |
▶ | } else { XPUSHs(&PL_sv_undef); } |
Branch: 1 branch
| Branch | True | False | Total |
| } else { XPUSHs(&PL_sv_undef); } |
0 |
0 |
0 |
|
| 228 |
0 |
| self->nodes[i].value = NULL; |
| 229 |
0 |
| hashmap_i32a_tombstone_at(self, i); |
| 230 |
0 |
▶ | HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
Branch: 4 branches
| Branch | True | False | Total |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
|
| 231 |
0 |
| XSRETURN(2); |
| 232 |
|
| } |
| 233 |
|
| } |
| 234 |
0 |
| self->drain_pos = 0; |
| 235 |
0 |
| XSRETURN_EMPTY; |
| 236 |
|
| } |
| 237 |
|
| |
| 238 |
|
| void |
| 239 |
|
| shift(SV* self_sv) |
| 240 |
|
| PPCODE: |
| 241 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 242 |
0 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
0 |
0 |
0 |
|
| 243 |
0 |
▶ | if (self->lru_prev) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->lru_prev) { |
0 |
0 |
0 |
|
| 244 |
0 |
▶ | while (self->lru_head != HM_LRU_NONE) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (self->lru_head != HM_LRU_NONE) { |
0 |
0 |
0 |
|
| 245 |
0 |
| uint32_t idx = self->lru_head; |
| 246 |
0 |
▶ | if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
Branch: 4 branches
| Branch | True | False | Total |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
| if (HM_UNLIKELY(HM_TTL_SKIP_EXPIRED(self, idx, now))) { |
0 |
0 |
0 |
|
| 247 |
0 |
| hashmap_i32a_expire_at(self, idx, true); continue; |
| 248 |
|
| } |
| 249 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 250 |
0 |
▶ | mXPUSHi(self->nodes[idx].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[idx].key); |
0 |
0 |
0 |
|
| 251 |
0 |
▶ | if (self->nodes[idx].value) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->nodes[idx].value) { |
0 |
0 |
0 |
|
| 252 |
0 |
▶ | mXPUSHs((SV*)self->nodes[idx].value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs((SV*)self->nodes[idx].value); |
0 |
0 |
0 |
|
| 253 |
0 |
▶ | } else { XPUSHs(&PL_sv_undef); } |
Branch: 1 branch
| Branch | True | False | Total |
| } else { XPUSHs(&PL_sv_undef); } |
0 |
0 |
0 |
|
| 254 |
0 |
| self->nodes[idx].value = NULL; |
| 255 |
0 |
| hashmap_i32a_lru_unlink(self, idx); |
| 256 |
0 |
| hashmap_i32a_tombstone_at(self, idx); |
| 257 |
0 |
▶ | HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
Branch: 4 branches
| Branch | True | False | Total |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
|
| 258 |
0 |
| XSRETURN(2); |
| 259 |
|
| } |
| 260 |
0 |
| XSRETURN_EMPTY; |
| 261 |
|
| } else { |
| 262 |
|
| size_t scanned; |
| 263 |
0 |
▶ | for (scanned = 0; scanned < self->capacity; scanned++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (scanned = 0; scanned < self->capacity; scanned++) { |
0 |
0 |
0 |
|
| 264 |
0 |
▶ | if (self->drain_pos == 0) self->drain_pos = self->capacity; |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->drain_pos == 0) self->drain_pos = self->capacity; |
0 |
0 |
0 |
|
| 265 |
0 |
| size_t i = --self->drain_pos; |
| 266 |
0 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
0 |
0 |
0 |
|
| 267 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 268 |
0 |
▶ | mXPUSHi(self->nodes[i].key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(self->nodes[i].key); |
0 |
0 |
0 |
|
| 269 |
0 |
▶ | if (self->nodes[i].value) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (self->nodes[i].value) { |
0 |
0 |
0 |
|
| 270 |
0 |
▶ | mXPUSHs((SV*)self->nodes[i].value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHs((SV*)self->nodes[i].value); |
0 |
0 |
0 |
|
| 271 |
0 |
▶ | } else { XPUSHs(&PL_sv_undef); } |
Branch: 1 branch
| Branch | True | False | Total |
| } else { XPUSHs(&PL_sv_undef); } |
0 |
0 |
0 |
|
| 272 |
0 |
| self->nodes[i].value = NULL; |
| 273 |
0 |
| hashmap_i32a_tombstone_at(self, i); |
| 274 |
0 |
▶ | HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
Branch: 4 branches
| Branch | True | False | Total |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
| HM_MAYBE_COMPACT_XS(self, hashmap_i32a_compact); |
0 |
0 |
0 |
|
| 275 |
0 |
| XSRETURN(2); |
| 276 |
|
| } |
| 277 |
|
| } |
| 278 |
0 |
| XSRETURN_EMPTY; |
| 279 |
|
| } |
| 280 |
|
| |
| 281 |
|
| |
| 282 |
|
| void |
| 283 |
|
| clear(SV* self_sv) |
| 284 |
|
| CODE: |
| 285 |
7 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
7 |
0 |
7 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
7 |
0 |
7 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
7 |
7 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
7 |
7 |
|
| 286 |
7 |
| sv_2mortal(SvREFCNT_inc_simple_NN(SvRV(self_sv))); /* a DESTROY may drop the last reference */ |
| 287 |
7 |
| hashmap_i32a_clear(self); |
| 288 |
|
| |
| 289 |
|
| void |
| 290 |
|
| reserve(SV* self_sv, UV count) |
| 291 |
|
| CODE: |
| 292 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 293 |
0 |
▶ | if (!hashmap_i32a_reserve(self, (size_t)count)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_reserve(self, (size_t)count)) |
0 |
0 |
0 |
|
| 294 |
0 |
| croak("Failed to reserve capacity"); |
| 295 |
|
| |
| 296 |
|
| void |
| 297 |
|
| purge(SV* self_sv) |
| 298 |
|
| CODE: |
| 299 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 300 |
0 |
| hashmap_i32a_purge(self); |
| 301 |
|
| |
| 302 |
|
| SV* |
| 303 |
|
| freeze(SV* self_sv) |
| 304 |
|
| CODE: |
| 305 |
|
| PERL_UNUSED_VAR(self_sv); |
| 306 |
0 |
| croak("freeze not supported for SV* variants; use to_hash + Storable"); |
| 307 |
|
| RETVAL = &PL_sv_undef; |
| 308 |
|
| OUTPUT: |
| 309 |
|
| RETVAL |
| 310 |
|
| |
| 311 |
|
| |
| 312 |
|
| UV |
| 313 |
|
| capacity(SV* self_sv) |
| 314 |
|
| CODE: |
| 315 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 316 |
0 |
▶ | RETVAL = (UV)self->capacity; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)self->capacity; |
0 |
0 |
0 |
|
| 317 |
|
| OUTPUT: |
| 318 |
|
| RETVAL |
| 319 |
|
| |
| 320 |
|
| bool |
| 321 |
|
| persist(SV* self_sv, int32_t key) |
| 322 |
|
| CODE: |
| 323 |
0 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
|
| 324 |
0 |
| RETVAL = hashmap_i32a_persist(self, key); |
| 325 |
|
| OUTPUT: |
| 326 |
|
| RETVAL |
| 327 |
|
| |
| 328 |
|
| SV* |
| 329 |
|
| swap(SV* self_sv, int32_t key, SV* new_val) |
| 330 |
|
| CODE: |
| 331 |
4 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
|
| 332 |
|
| void* old; |
| 333 |
4 |
▶ | new_val = HM_STORE_SV(self, new_val, newSVsv(new_val)); |
Branch: 1 branch
| Branch | True | False | Total |
| new_val = HM_STORE_SV(self, new_val, newSVsv(new_val)); |
3 |
1 |
4 |
|
| 334 |
4 |
▶ | if (!hashmap_i32a_swap(self, key, (void*)new_val, &old)) { SvREFCNT_dec(new_val); XSRETURN_UNDEF; } |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_swap(self, key, (void*)new_val, &old)) { SvREFCNT_dec(new_val); XSRETURN_UNDEF; } |
0 |
4 |
4 |
|
| 335 |
4 |
| RETVAL = (SV*)old; |
| 336 |
|
| OUTPUT: |
| 337 |
|
| RETVAL |
| 338 |
|
| |
| 339 |
|
| |
| 340 |
|
| SV* |
| 341 |
|
| clone(SV* self_sv) |
| 342 |
|
| CODE: |
| 343 |
4 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
|
| 344 |
4 |
| HashMapI32A* clone = hashmap_i32a_clone(self); |
| 345 |
4 |
▶ | if (!clone) croak("Failed to clone"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!clone) croak("Failed to clone"); |
0 |
4 |
4 |
|
| 346 |
292 |
▶ | { size_t _i; for (_i = 0; _i < clone->capacity; _i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| { size_t _i; for (_i = 0; _i < clone->capacity; _i++) { |
288 |
4 |
292 |
|
| 347 |
288 |
▶ | if (I32A_NODE_LIVE(clone->nodes[_i]) && clone->nodes[_i].value) |
Branch: 3 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(clone->nodes[_i]) && clone->nodes[_i].value) |
118 |
170 |
288 |
| if (I32A_NODE_LIVE(clone->nodes[_i]) && clone->nodes[_i].value) |
116 |
2 |
118 |
| if (I32A_NODE_LIVE(clone->nodes[_i]) && clone->nodes[_i].value) |
116 |
0 |
116 |
|
| 348 |
116 |
▶ | clone->nodes[_i].value = HM_STORE_SV(clone, (SV*)clone->nodes[_i].value, newSVsv((SV*)clone->nodes[_i].value)); |
Branch: 1 branch
| Branch | True | False | Total |
| clone->nodes[_i].value = HM_STORE_SV(clone, (SV*)clone->nodes[_i].value, newSVsv((SV*)clone->nodes[_i].value)); |
110 |
6 |
116 |
|
| 349 |
|
| } } |
| 350 |
4 |
▶ | RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
Branch: 6 branches
| Branch | True | False | Total |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
4 |
0 |
4 |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
4 |
0 |
4 |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
0 |
4 |
4 |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
0 |
0 |
0 |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
4 |
0 |
4 |
| RETVAL = sv_setref_pv(newSV(0), HvNAME(SvSTASH(SvRV(self_sv))), (void*)clone); |
0 |
4 |
4 |
|
| 351 |
|
| OUTPUT: |
| 352 |
|
| RETVAL |
| 353 |
|
| |
| 354 |
|
| void |
| 355 |
|
| from_hash(SV* self_sv, SV* href) |
| 356 |
|
| CODE: |
| 357 |
5 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
|
| 358 |
5 |
▶ | if (!SvROK(href) || SvTYPE(SvRV(href)) != SVt_PVHV) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!SvROK(href) || SvTYPE(SvRV(href)) != SVt_PVHV) |
5 |
0 |
5 |
| if (!SvROK(href) || SvTYPE(SvRV(href)) != SVt_PVHV) |
0 |
5 |
5 |
|
| 359 |
0 |
| croak("from_hash requires a hashref"); |
| 360 |
5 |
| HV* hv = (HV*)SvRV(href); |
| 361 |
5 |
▶ | if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
Branch: 5 branches
| Branch | True | False | Total |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
0 |
5 |
5 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
0 |
0 |
0 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
0 |
0 |
0 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
1 |
4 |
5 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, (size_t)HvUSEDKEYS(hv)))) croak("OOM during from_hash"); |
0 |
5 |
5 |
|
| 362 |
5 |
| hv_iterinit(hv); |
| 363 |
|
| HE* he; |
| 364 |
10 |
▶ | while ((he = hv_iternext(hv))) { |
Branch: 1 branch
| Branch | True | False | Total |
| while ((he = hv_iternext(hv))) { |
5 |
5 |
10 |
|
| 365 |
5 |
| SV* ksv = hv_iterkeysv(he); |
| 366 |
5 |
| int32_t key; HM_SV_TO_I32(key, ksv); |
| 367 |
5 |
▶ | if (hashmap_i32a_key_is_reserved(key)) continue; |
Branch: 1 branch
| Branch | True | False | Total |
| if (hashmap_i32a_key_is_reserved(key)) continue; |
0 |
5 |
5 |
|
| 368 |
5 |
| SV* val = hv_iterval(hv, he); /* HeVAL is NULL for a tied hash */ |
| 369 |
5 |
▶ | val = HM_STORE_SV(self, val, newSVsv(val)); |
Branch: 1 branch
| Branch | True | False | Total |
| val = HM_STORE_SV(self, val, newSVsv(val)); |
3 |
2 |
5 |
|
| 370 |
5 |
▶ | if (!hashmap_i32a_put(self, key, (void*)val, 0)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_put(self, key, (void*)val, 0)) { |
0 |
5 |
5 |
|
| 371 |
0 |
| SvREFCNT_dec(val); |
| 372 |
0 |
| croak("OOM during from_hash"); |
| 373 |
|
| } |
| 374 |
|
| } |
| 375 |
|
| |
| 376 |
|
| void |
| 377 |
|
| merge(SV* self_sv, SV* other_sv) |
| 378 |
|
| CODE: |
| 379 |
4 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
4 |
0 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
4 |
4 |
|
| 380 |
4 |
▶ | EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
4 |
0 |
4 |
| EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
4 |
0 |
4 |
| EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
0 |
4 |
4 |
| EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
0 |
0 |
0 |
| EXTRACT_OTHER_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", other_sv); |
0 |
4 |
4 |
|
| 381 |
4 |
▶ | if (self == other) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (self == other) XSRETURN_EMPTY; |
0 |
4 |
4 |
|
| 382 |
4 |
▶ | if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, other->size))) croak("OOM during merge"); |
Branch: 3 branches
| Branch | True | False | Total |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, other->size))) croak("OOM during merge"); |
0 |
4 |
4 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, other->size))) croak("OOM during merge"); |
0 |
0 |
0 |
| if (!hashmap_i32a_reserve(self, HM_RESERVE_FOR(self, other->size))) croak("OOM during merge"); |
0 |
4 |
4 |
|
| 383 |
4 |
▶ | uint32_t now = other->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = other->expires_at ? (uint32_t)time(NULL) : 0; |
2 |
2 |
4 |
|
| 384 |
|
| size_t i; |
| 385 |
292 |
▶ | for (i = 0; i < other->capacity; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; i < other->capacity; i++) { |
288 |
4 |
292 |
|
| 386 |
288 |
▶ | if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
108 |
180 |
288 |
| if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
106 |
2 |
108 |
| if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
104 |
2 |
106 |
| if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
2 |
102 |
104 |
| if (I32A_NODE_LIVE(other->nodes[i]) && !HM_TTL_SKIP_EXPIRED(other, i, now)) { |
2 |
0 |
2 |
|
| 387 |
106 |
▶ | SV* _copy = HM_STORE_SV(self, (SV*)other->nodes[i].value, newSVsv((SV*)other->nodes[i].value)); |
Branch: 1 branch
| Branch | True | False | Total |
| SV* _copy = HM_STORE_SV(self, (SV*)other->nodes[i].value, newSVsv((SV*)other->nodes[i].value)); |
105 |
1 |
106 |
|
| 388 |
106 |
▶ | if (!hashmap_i32a_put(self, other->nodes[i].key, (void*)_copy, 0)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!hashmap_i32a_put(self, other->nodes[i].key, (void*)_copy, 0)) { |
0 |
106 |
106 |
|
| 389 |
0 |
| SvREFCNT_dec(_copy); |
| 390 |
0 |
| croak("OOM during merge"); |
| 391 |
|
| } |
| 392 |
|
| } |
| 393 |
|
| } |
| 394 |
|
| |
| 395 |
|
| |
| 396 |
|
| SV* |
| 397 |
|
| to_hash(SV* self_sv) |
| 398 |
|
| CODE: |
| 399 |
5 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
|
| 400 |
5 |
| HV* hv = newHV(); |
| 401 |
5 |
▶ | uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = self->expires_at ? (uint32_t)time(NULL) : 0; |
4 |
1 |
5 |
|
| 402 |
|
| size_t i; |
| 403 |
309 |
▶ | for (i = 0; i < self->capacity; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; i < self->capacity; i++) { |
304 |
5 |
309 |
|
| 404 |
304 |
▶ | if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
Branch: 5 branches
| Branch | True | False | Total |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
119 |
185 |
304 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
117 |
2 |
119 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
116 |
1 |
117 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
4 |
112 |
116 |
| if (I32A_NODE_LIVE(self->nodes[i]) && !HM_TTL_SKIP_EXPIRED(self, i, now)) { |
4 |
0 |
4 |
|
| 405 |
117 |
▶ | SV* val = self->nodes[i].value ? HM_STORE_SV(self, (SV*)self->nodes[i].value, newSVsv((SV*)self->nodes[i].value)) : newSV(0); |
Branch: 2 branches
| Branch | True | False | Total |
| SV* val = self->nodes[i].value ? HM_STORE_SV(self, (SV*)self->nodes[i].value, newSVsv((SV*)self->nodes[i].value)) : newSV(0); |
117 |
0 |
117 |
| SV* val = self->nodes[i].value ? HM_STORE_SV(self, (SV*)self->nodes[i].value, newSVsv((SV*)self->nodes[i].value)) : newSV(0); |
110 |
7 |
117 |
|
| 406 |
|
| char kbuf[24]; |
| 407 |
117 |
| int klen = my_snprintf(kbuf, sizeof(kbuf), "%" IVdf, (IV)self->nodes[i].key); |
| 408 |
117 |
| (void)hv_store(hv, kbuf, klen, val, 0); |
| 409 |
|
| } |
| 410 |
|
| } |
| 411 |
5 |
| RETVAL = newRV_noinc((SV*)hv); |
| 412 |
|
| OUTPUT: |
| 413 |
|
| RETVAL |
| 414 |
|
| |
| 415 |
|
| bool |
| 416 |
|
| put_ttl(SV* self_sv, int32_t key, SV* value, SV* ttl) |
| 417 |
|
| CODE: |
| 418 |
5 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
5 |
0 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
5 |
5 |
|
| 419 |
|
| /* Before the copy: it can croak, and would orphan the copy. */ |
| 420 |
5 |
| uint32_t _ttl = hm_ttl_arg(aTHX_ ttl); |
| 421 |
4 |
▶ | value = HM_STORE_SV(self, value, newSVsv(value)); |
Branch: 1 branch
| Branch | True | False | Total |
| value = HM_STORE_SV(self, value, newSVsv(value)); |
3 |
1 |
4 |
|
| 422 |
4 |
| RETVAL = hashmap_i32a_put(self, key, (void*)value, _ttl); |
| 423 |
4 |
▶ | if (!RETVAL) SvREFCNT_dec(value); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!RETVAL) SvREFCNT_dec(value); |
0 |
4 |
4 |
|
| 424 |
|
| OUTPUT: |
| 425 |
|
| RETVAL |
| 426 |
|
| |
| 427 |
|
| SV* |
| 428 |
|
| get_or_set(SV* self_sv, int32_t key, SV* default_value) |
| 429 |
|
| CODE: |
| 430 |
8 |
▶ | EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
Branch: 5 branches
| Branch | True | False | Total |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
8 |
0 |
8 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
8 |
0 |
8 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
8 |
8 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP(HashMapI32A, stash_i32a, "Data::HashMap::I32A", self_sv); |
0 |
8 |
8 |
|
| 431 |
|
| bool was_found; |
| 432 |
8 |
▶ | default_value = HM_STORE_SV(self, default_value, newSVsv(default_value)); |
Branch: 1 branch
| Branch | True | False | Total |
| default_value = HM_STORE_SV(self, default_value, newSVsv(default_value)); |
5 |
3 |
8 |
|
| 433 |
8 |
| size_t idx = hashmap_i32a_get_or_set(self, key, (void*)default_value, 0, &was_found); |
| 434 |
8 |
▶ | if (idx >= self->capacity) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (idx >= self->capacity) { |
0 |
8 |
8 |
|
| 435 |
0 |
| SvREFCNT_dec(default_value); |
| 436 |
0 |
| XSRETURN_UNDEF; |
| 437 |
|
| } |
| 438 |
8 |
▶ | if (was_found) SvREFCNT_dec(default_value); |
Branch: 1 branch
| Branch | True | False | Total |
| if (was_found) SvREFCNT_dec(default_value); |
2 |
6 |
8 |
|
| 439 |
8 |
| RETVAL = SvREFCNT_inc((SV*)self->nodes[idx].value); |
| 440 |
|
| OUTPUT: |
| 441 |
|
| RETVAL |
| 442 |
|
| |
| 443 |
|
| |
| 444 |
|
| |