| 1 |
|
| MODULE = Data::HashMap::Shared PACKAGE = Data::HashMap::Shared::I16 |
| 2 |
|
| PROTOTYPES: DISABLE |
| 3 |
|
| |
| 4 |
|
| SV* |
| 5 |
|
| new(SV* class_sv, SV* path_sv, SV* max_entries_sv, SV* lru_max_sv = NULL, SV* ttl_default_sv = NULL, SV* lru_skip_sv = NULL, SV* arena_cap_sv = NULL, SV* file_mode_sv = NULL) |
| 6 |
|
| CODE: |
| 7 |
36 |
| const char *class = shm_invocant_class(aTHX_ class_sv, "Data::HashMap::Shared::I16"); |
| 8 |
36 |
| uint32_t max_entries = shm_u32_arg(aTHX_ max_entries_sv, "max_entries", "Data::HashMap::Shared::I16", 0); |
| 9 |
35 |
| uint32_t lru_max = shm_u32_arg(aTHX_ lru_max_sv, "lru_max", "Data::HashMap::Shared::I16", 0); |
| 10 |
34 |
| uint32_t ttl_default = shm_u32_arg(aTHX_ ttl_default_sv, "ttl_default", "Data::HashMap::Shared::I16", 0); |
| 11 |
33 |
| uint32_t lru_skip = shm_u32_arg(aTHX_ lru_skip_sv, "lru_skip", "Data::HashMap::Shared::I16", 0); |
| 12 |
32 |
▶ | uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
0 |
32 |
32 |
|
| 13 |
32 |
▶ | UV file_mode = file_mode_sv ? shm_count_arg(aTHX_ file_mode_sv, "file_mode", "Data::HashMap::Shared::I16") : 0600; |
Branch: 1 branch
| Branch | True | False | Total |
| UV file_mode = file_mode_sv ? shm_count_arg(aTHX_ file_mode_sv, "file_mode", "Data::HashMap::Shared::I16") : 0600; |
0 |
32 |
32 |
|
| 14 |
32 |
▶ | char errbuf[SHM_ERR_BUFLEN]; const char* path = SHM_WRITE_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16", "new"); ShmHandle* map = shm_i16_create(path, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, shm_file_mode(aTHX_ file_mode, "Data::HashMap::Shared::I16"), errbuf); |
Branch: 3 branches
| Branch | True | False | Total |
| char errbuf[SHM_ERR_BUFLEN]; const char* path = SHM_WRITE_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16", "new"); ShmHandle* map = shm_i16_create(path, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, shm_file_mode(aTHX_ file_mode, "Data::HashMap::Shared::I16"), errbuf); |
0 |
32 |
32 |
| char errbuf[SHM_ERR_BUFLEN]; const char* path = SHM_WRITE_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16", "new"); ShmHandle* map = shm_i16_create(path, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, shm_file_mode(aTHX_ file_mode, "Data::HashMap::Shared::I16"), errbuf); |
0 |
0 |
0 |
| char errbuf[SHM_ERR_BUFLEN]; const char* path = SHM_WRITE_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16", "new"); ShmHandle* map = shm_i16_create(path, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, shm_file_mode(aTHX_ file_mode, "Data::HashMap::Shared::I16"), errbuf); |
25 |
7 |
32 |
|
| 15 |
32 |
▶ | if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
32 |
32 |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
|
| 16 |
32 |
▶ | SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
Branch: 2 branches
| Branch | True | False | Total |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
32 |
32 |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
32 |
32 |
|
| 17 |
|
| OUTPUT: |
| 18 |
|
| RETVAL |
| 19 |
|
| |
| 20 |
|
| SV* |
| 21 |
|
| new_sharded(SV* class_sv, SV* path_prefix_sv, SV* num_shards_sv, SV* max_entries_sv, SV* lru_max_sv = NULL, SV* ttl_default_sv = NULL, SV* lru_skip_sv = NULL, SV* arena_cap_sv = NULL, SV* file_mode_sv = NULL) |
| 22 |
|
| CODE: |
| 23 |
10 |
| const char *class = shm_invocant_class(aTHX_ class_sv, "Data::HashMap::Shared::I16"); |
| 24 |
10 |
▶ | const char* path_prefix = SHM_WRITE_PATH_ARG(path_prefix_sv, "path prefix", "Data::HashMap::Shared::I16", "new_sharded"); |
Branch: 3 branches
| Branch | True | False | Total |
| const char* path_prefix = SHM_WRITE_PATH_ARG(path_prefix_sv, "path prefix", "Data::HashMap::Shared::I16", "new_sharded"); |
0 |
10 |
10 |
| const char* path_prefix = SHM_WRITE_PATH_ARG(path_prefix_sv, "path prefix", "Data::HashMap::Shared::I16", "new_sharded"); |
0 |
0 |
0 |
| const char* path_prefix = SHM_WRITE_PATH_ARG(path_prefix_sv, "path prefix", "Data::HashMap::Shared::I16", "new_sharded"); |
10 |
0 |
10 |
|
| 25 |
10 |
| uint32_t max_entries = shm_u32_arg(aTHX_ max_entries_sv, "max_entries", "Data::HashMap::Shared::I16", 0); |
| 26 |
9 |
| uint32_t lru_max = shm_u32_arg(aTHX_ lru_max_sv, "lru_max", "Data::HashMap::Shared::I16", 0); |
| 27 |
8 |
| uint32_t ttl_default = shm_u32_arg(aTHX_ ttl_default_sv, "ttl_default", "Data::HashMap::Shared::I16", 0); |
| 28 |
7 |
| uint32_t lru_skip = shm_u32_arg(aTHX_ lru_skip_sv, "lru_skip", "Data::HashMap::Shared::I16", 0); |
| 29 |
6 |
▶ | uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
0 |
6 |
6 |
|
| 30 |
6 |
▶ | UV file_mode = file_mode_sv ? shm_count_arg(aTHX_ file_mode_sv, "file_mode", "Data::HashMap::Shared::I16") : 0600; |
Branch: 1 branch
| Branch | True | False | Total |
| UV file_mode = file_mode_sv ? shm_count_arg(aTHX_ file_mode_sv, "file_mode", "Data::HashMap::Shared::I16") : 0600; |
0 |
6 |
6 |
|
| 31 |
6 |
| uint32_t num_shards = shm_u32_arg(aTHX_ num_shards_sv, "num_shards", "Data::HashMap::Shared::I16", 0); |
| 32 |
5 |
| char errbuf[SHM_ERR_BUFLEN]; ShmHandle* map = shm_i16_create_sharded(path_prefix, (uint32_t)num_shards, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, shm_file_mode(aTHX_ file_mode, "Data::HashMap::Shared::I16"), errbuf); |
| 33 |
5 |
▶ | if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
5 |
5 |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
|
| 34 |
5 |
▶ | SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
Branch: 2 branches
| Branch | True | False | Total |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
5 |
0 |
5 |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
5 |
5 |
|
| 35 |
|
| OUTPUT: |
| 36 |
|
| RETVAL |
| 37 |
|
| |
| 38 |
|
| |
| 39 |
|
| SV* |
| 40 |
|
| new_memfd(SV* class_sv, SV* name_sv, SV* max_entries_sv, SV* lru_max_sv = NULL, SV* ttl_default_sv = NULL, SV* lru_skip_sv = NULL, SV* arena_cap_sv = NULL) |
| 41 |
|
| CODE: |
| 42 |
4 |
| const char *class = shm_invocant_class(aTHX_ class_sv, "Data::HashMap::Shared::I16"); |
| 43 |
|
| char errbuf[SHM_ERR_BUFLEN]; |
| 44 |
4 |
▶ | const char* name = SHM_PATH_ARG(name_sv, "name", "Data::HashMap::Shared::I16"); |
Branch: 3 branches
| Branch | True | False | Total |
| const char* name = SHM_PATH_ARG(name_sv, "name", "Data::HashMap::Shared::I16"); |
0 |
4 |
4 |
| const char* name = SHM_PATH_ARG(name_sv, "name", "Data::HashMap::Shared::I16"); |
0 |
0 |
0 |
| const char* name = SHM_PATH_ARG(name_sv, "name", "Data::HashMap::Shared::I16"); |
4 |
0 |
4 |
|
| 45 |
4 |
| uint32_t max_entries = shm_u32_arg(aTHX_ max_entries_sv, "max_entries", "Data::HashMap::Shared::I16", 0); |
| 46 |
3 |
| uint32_t lru_max = shm_u32_arg(aTHX_ lru_max_sv, "lru_max", "Data::HashMap::Shared::I16", 0); |
| 47 |
2 |
| uint32_t ttl_default = shm_u32_arg(aTHX_ ttl_default_sv, "ttl_default", "Data::HashMap::Shared::I16", 0); |
| 48 |
1 |
| uint32_t lru_skip = shm_u32_arg(aTHX_ lru_skip_sv, "lru_skip", "Data::HashMap::Shared::I16", 0); |
| 49 |
0 |
▶ | uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint64_t arena_cap = arena_cap_sv ? shm_count_arg(aTHX_ arena_cap_sv, "arena_cap", "Data::HashMap::Shared::I16") : 0; |
0 |
0 |
0 |
|
| 50 |
0 |
| ShmHandle* map = shm_i16_create_memfd(name, (uint32_t)max_entries, (uint32_t)lru_max, (uint32_t)ttl_default, (uint32_t)lru_skip, (uint64_t)arena_cap, errbuf); |
| 51 |
0 |
▶ | if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
|
| 52 |
0 |
▶ | SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
Branch: 2 branches
| Branch | True | False | Total |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
0 |
0 |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
0 |
0 |
|
| 53 |
|
| OUTPUT: |
| 54 |
|
| RETVAL |
| 55 |
|
| |
| 56 |
|
| SV* |
| 57 |
|
| new_from_fd(SV* class_sv, int fd) |
| 58 |
|
| CODE: |
| 59 |
0 |
| const char *class = shm_invocant_class(aTHX_ class_sv, "Data::HashMap::Shared::I16"); |
| 60 |
|
| char errbuf[SHM_ERR_BUFLEN]; |
| 61 |
0 |
▶ | SHM_TAINT_CHECK("Data::HashMap::Shared::I16->new_from_fd"); |
Branch: 1 branch
| Branch | True | False | Total |
| SHM_TAINT_CHECK("Data::HashMap::Shared::I16->new_from_fd"); |
0 |
0 |
0 |
|
| 62 |
0 |
| ShmHandle* map = shm_i16_open_fd(fd, errbuf); |
| 63 |
0 |
▶ | if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
|
| 64 |
0 |
▶ | SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
Branch: 2 branches
| Branch | True | False | Total |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
0 |
0 |
| SHM_RETURN_MAP(map, "Data::HashMap::Shared::I16", class); |
0 |
0 |
0 |
|
| 65 |
|
| OUTPUT: |
| 66 |
|
| RETVAL |
| 67 |
|
| |
| 68 |
|
| SV* |
| 69 |
|
| new_readonly(SV* class_sv, SV* path_sv) |
| 70 |
|
| CODE: |
| 71 |
1 |
| const char *class = shm_invocant_class(aTHX_ class_sv, "Data::HashMap::Shared::I16"); |
| 72 |
|
| char errbuf[SHM_ERR_BUFLEN]; |
| 73 |
1 |
▶ | const char* path = SHM_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16"); |
Branch: 3 branches
| Branch | True | False | Total |
| const char* path = SHM_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16"); |
0 |
1 |
1 |
| const char* path = SHM_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16"); |
0 |
0 |
0 |
| const char* path = SHM_PATH_ARG(path_sv, "path", "Data::HashMap::Shared::I16"); |
0 |
1 |
1 |
|
| 74 |
1 |
▶ | if (!path) croak("Data::HashMap::Shared::I16->new_readonly: path is required"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!path) croak("Data::HashMap::Shared::I16->new_readonly: path is required"); |
1 |
0 |
1 |
|
| 75 |
0 |
| ShmHandle* map = shm_i16_open_readonly(path, errbuf); |
| 76 |
0 |
▶ | if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
| if (!map) croak("Data::HashMap::Shared::I16: %s", errbuf[0] ? errbuf : "unknown error"); |
0 |
0 |
0 |
|
| 77 |
0 |
| RETVAL = sv_setref_pv(newSV(0), class, (void*)map); |
| 78 |
|
| OUTPUT: |
| 79 |
|
| RETVAL |
| 80 |
|
| |
| 81 |
|
| void |
| 82 |
|
| freeze(SV* self_sv) |
| 83 |
|
| CODE: |
| 84 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 85 |
3 |
▶ | if (h->readonly || shm_is_fully_sealed(h)) croak("Data::HashMap::Shared::I16->freeze: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_fully_sealed(h)) croak("Data::HashMap::Shared::I16->freeze: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_fully_sealed(h)) croak("Data::HashMap::Shared::I16->freeze: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 86 |
1 |
▶ | if (shm_freeze(h) != 0) croak("Data::HashMap::Shared::I16->freeze: msync: %s", strerror(errno)); |
Branch: 1 branch
| Branch | True | False | Total |
| if (shm_freeze(h) != 0) croak("Data::HashMap::Shared::I16->freeze: msync: %s", strerror(errno)); |
0 |
1 |
1 |
|
| 87 |
1 |
| shm_mark_readonly(h); |
| 88 |
|
| |
| 89 |
|
| UV |
| 90 |
|
| frozen(SV* self_sv) |
| 91 |
|
| CODE: |
| 92 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 93 |
0 |
▶ | RETVAL = (UV)shm_is_sealed(h); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)shm_is_sealed(h); |
0 |
0 |
0 |
|
| 94 |
|
| OUTPUT: |
| 95 |
|
| RETVAL |
| 96 |
|
| |
| 97 |
|
| UV |
| 98 |
|
| readonly(SV* self_sv) |
| 99 |
|
| CODE: |
| 100 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 101 |
2 |
▶ | RETVAL = (UV)(h->readonly ? 1 : 0); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = (UV)(h->readonly ? 1 : 0); |
1 |
1 |
2 |
| RETVAL = (UV)(h->readonly ? 1 : 0); |
0 |
2 |
2 |
|
| 102 |
|
| OUTPUT: |
| 103 |
|
| RETVAL |
| 104 |
|
| |
| 105 |
|
| IV |
| 106 |
|
| memfd(SV* self_sv) |
| 107 |
|
| CODE: |
| 108 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 109 |
0 |
▶ | RETVAL = h->backing_fd; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = h->backing_fd; |
0 |
0 |
0 |
|
| 110 |
|
| OUTPUT: |
| 111 |
|
| RETVAL |
| 112 |
|
| |
| 113 |
|
| |
| 114 |
|
| void |
| 115 |
|
| sync(SV* self_sv) |
| 116 |
|
| CODE: |
| 117 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 118 |
0 |
▶ | if (shm_msync(h) != 0) croak("Data::HashMap::Shared::I16->sync: %s", strerror(errno)); |
Branch: 1 branch
| Branch | True | False | Total |
| if (shm_msync(h) != 0) croak("Data::HashMap::Shared::I16->sync: %s", strerror(errno)); |
0 |
0 |
0 |
|
| 119 |
|
| |
| 120 |
|
| void |
| 121 |
|
| DESTROY(SV* self_sv) |
| 122 |
|
| CODE: |
| 123 |
37 |
▶ | if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16")) return; |
Branch: 2 branches
| Branch | True | False | Total |
| if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16")) return; |
37 |
0 |
37 |
| if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16")) return; |
0 |
37 |
37 |
|
| 124 |
37 |
| ShmHandle* h = INT2PTR(ShmHandle*, SvIV(SvRV(self_sv))); |
| 125 |
37 |
▶ | if (!h) return; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!h) return; |
0 |
37 |
37 |
|
| 126 |
37 |
| sv_setiv(SvRV(self_sv), 0); |
| 127 |
37 |
| shm_close_map(h); |
| 128 |
|
| |
| 129 |
|
| bool |
| 130 |
|
| put(SV* self_sv, int16_t key, int16_t value) |
| 131 |
|
| CODE: |
| 132 |
216 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
9 |
207 |
216 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
207 |
207 |
|
| 133 |
207 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
206 |
1 |
207 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
205 |
206 |
|
| 134 |
205 |
▶ | RETVAL = shm_i16_put(h, key, value); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_put(h, key, value); |
202 |
3 |
205 |
|
| 135 |
|
| OUTPUT: |
| 136 |
|
| RETVAL |
| 137 |
|
| |
| 138 |
|
| SV* |
| 139 |
|
| get(SV* self_sv, int16_t key) |
| 140 |
|
| CODE: |
| 141 |
53 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
9 |
44 |
53 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
44 |
44 |
|
| 142 |
|
| int16_t value; |
| 143 |
44 |
▶ | if (!shm_i16_get(h, key, &value)) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_get(h, key, &value)) XSRETURN_UNDEF; |
4 |
40 |
44 |
|
| 144 |
40 |
| RETVAL = newSViv(value); |
| 145 |
|
| OUTPUT: |
| 146 |
|
| RETVAL |
| 147 |
|
| |
| 148 |
|
| bool |
| 149 |
|
| remove(SV* self_sv, int16_t key) |
| 150 |
|
| CODE: |
| 151 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 152 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 153 |
2 |
▶ | RETVAL = shm_i16_remove(h, key); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_remove(h, key); |
2 |
0 |
2 |
|
| 154 |
|
| OUTPUT: |
| 155 |
|
| RETVAL |
| 156 |
|
| |
| 157 |
|
| bool |
| 158 |
|
| exists(SV* self_sv, int16_t key) |
| 159 |
|
| CODE: |
| 160 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 161 |
2 |
▶ | RETVAL = shm_i16_exists(h, key); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_exists(h, key); |
1 |
1 |
2 |
|
| 162 |
|
| OUTPUT: |
| 163 |
|
| RETVAL |
| 164 |
|
| |
| 165 |
|
| SV* |
| 166 |
|
| incr(SV* self_sv, int16_t key) |
| 167 |
|
| CODE: |
| 168 |
7 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
7 |
7 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
7 |
7 |
|
| 169 |
7 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
6 |
1 |
7 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
5 |
6 |
|
| 170 |
|
| int ok; |
| 171 |
5 |
| int16_t val = shm_i16_incr_by(h, key, 1, &ok); |
| 172 |
5 |
▶ | if (!ok) croak("Data::HashMap::Shared::I16: increment failed: no room for a new key"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ok) croak("Data::HashMap::Shared::I16: increment failed: no room for a new key"); |
1 |
4 |
5 |
|
| 173 |
4 |
| RETVAL = newSViv(val); |
| 174 |
|
| OUTPUT: |
| 175 |
|
| RETVAL |
| 176 |
|
| |
| 177 |
|
| SV* |
| 178 |
|
| decr(SV* self_sv, int16_t key) |
| 179 |
|
| CODE: |
| 180 |
6 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
|
| 181 |
6 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
5 |
1 |
6 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
4 |
5 |
|
| 182 |
|
| int ok; |
| 183 |
4 |
| int16_t val = shm_i16_incr_by(h, key, -1, &ok); |
| 184 |
4 |
▶ | if (!ok) croak("Data::HashMap::Shared::I16: decrement failed: no room for a new key"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ok) croak("Data::HashMap::Shared::I16: decrement failed: no room for a new key"); |
1 |
3 |
4 |
|
| 185 |
3 |
| RETVAL = newSViv(val); |
| 186 |
|
| OUTPUT: |
| 187 |
|
| RETVAL |
| 188 |
|
| |
| 189 |
|
| SV* |
| 190 |
|
| incr_by(SV* self_sv, int16_t key, int16_t delta) |
| 191 |
|
| CODE: |
| 192 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 193 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 194 |
|
| int ok; |
| 195 |
2 |
| int16_t val = shm_i16_incr_by(h, key, delta, &ok); |
| 196 |
2 |
▶ | if (!ok) croak("Data::HashMap::Shared::I16: incr_by failed: no room for a new key"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ok) croak("Data::HashMap::Shared::I16: incr_by failed: no room for a new key"); |
1 |
1 |
2 |
|
| 197 |
1 |
| RETVAL = newSViv(val); |
| 198 |
|
| OUTPUT: |
| 199 |
|
| RETVAL |
| 200 |
|
| |
| 201 |
|
| SV* |
| 202 |
|
| max(SV* self_sv, int16_t key, int16_t desired) |
| 203 |
|
| CODE: |
| 204 |
6 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
|
| 205 |
6 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
5 |
1 |
6 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
4 |
5 |
|
| 206 |
|
| int ok; |
| 207 |
4 |
| int16_t val = shm_i16_set_minmax(h, key, desired, 1, &ok); |
| 208 |
4 |
▶ | if (!ok) croak("Data::HashMap::Shared::I16: max failed: no room for a new key"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ok) croak("Data::HashMap::Shared::I16: max failed: no room for a new key"); |
1 |
3 |
4 |
|
| 209 |
3 |
| RETVAL = newSViv(val); |
| 210 |
|
| OUTPUT: |
| 211 |
|
| RETVAL |
| 212 |
|
| |
| 213 |
|
| SV* |
| 214 |
|
| min(SV* self_sv, int16_t key, int16_t desired) |
| 215 |
|
| CODE: |
| 216 |
6 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
|
| 217 |
6 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
5 |
1 |
6 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
4 |
5 |
|
| 218 |
|
| int ok; |
| 219 |
4 |
| int16_t val = shm_i16_set_minmax(h, key, desired, 0, &ok); |
| 220 |
4 |
▶ | if (!ok) croak("Data::HashMap::Shared::I16: min failed: no room for a new key"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ok) croak("Data::HashMap::Shared::I16: min failed: no room for a new key"); |
1 |
3 |
4 |
|
| 221 |
3 |
| RETVAL = newSViv(val); |
| 222 |
|
| OUTPUT: |
| 223 |
|
| RETVAL |
| 224 |
|
| |
| 225 |
|
| UV |
| 226 |
|
| size(SV* self_sv) |
| 227 |
|
| CODE: |
| 228 |
15 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
10 |
5 |
15 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
5 |
5 |
|
| 229 |
5 |
| RETVAL = (UV)shm_i16_size(h); |
| 230 |
|
| OUTPUT: |
| 231 |
|
| RETVAL |
| 232 |
|
| |
| 233 |
|
| UV |
| 234 |
|
| max_entries(SV* self_sv) |
| 235 |
|
| CODE: |
| 236 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 237 |
0 |
| RETVAL = (UV)shm_i16_max_entries(h); |
| 238 |
|
| OUTPUT: |
| 239 |
|
| RETVAL |
| 240 |
|
| |
| 241 |
|
| void |
| 242 |
|
| keys(SV* self_sv) |
| 243 |
|
| PPCODE: |
| 244 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 245 |
154 |
▶ | SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
Branch: 15 branches
| Branch | True | False | Total |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
1 |
3 |
4 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
4 |
3 |
7 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
5 |
2 |
7 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
0 |
7 |
7 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
0 |
7 |
7 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
95 |
48 |
143 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
90 |
5 |
95 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
90 |
0 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
88 |
2 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
145 |
5 |
150 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
143 |
2 |
145 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, SHM_COPY_INT(nodes[i].key)); |
7 |
4 |
11 |
|
| 246 |
|
| |
| 247 |
|
| void |
| 248 |
|
| values(SV* self_sv) |
| 249 |
|
| PPCODE: |
| 250 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 251 |
137 |
▶ | SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
Branch: 15 branches
| Branch | True | False | Total |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
1 |
2 |
3 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
4 |
2 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
5 |
1 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
0 |
6 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
0 |
6 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
90 |
38 |
128 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
90 |
0 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
90 |
0 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
88 |
2 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
129 |
5 |
134 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
128 |
1 |
129 |
| SHM_LIST_COPIES(ShmNodeI16, 1, 0, |
6 |
3 |
9 |
|
| 252 |
|
| SHM_COPY_INT(__atomic_load_n(&nodes[i].value, __ATOMIC_RELAXED))); |
| 253 |
|
| |
| 254 |
|
| void |
| 255 |
|
| items(SV* self_sv) |
| 256 |
|
| PPCODE: |
| 257 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 258 |
137 |
▶ | SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
Branch: 15 branches
| Branch | True | False | Total |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
1 |
2 |
3 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
4 |
2 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
5 |
1 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
0 |
6 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
0 |
6 |
6 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
0 |
0 |
0 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
90 |
38 |
128 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
90 |
0 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
90 |
0 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
88 |
2 |
90 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
129 |
5 |
134 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
128 |
1 |
129 |
| SHM_LIST_COPIES(ShmNodeI16, 2, 0, |
6 |
3 |
9 |
|
| 259 |
|
| SHM_COPY_INT(nodes[i].key); |
| 260 |
|
| SHM_COPY_INT(__atomic_load_n(&nodes[i].value, __ATOMIC_RELAXED))); |
| 261 |
|
| |
| 262 |
|
| |
| 263 |
|
| void |
| 264 |
|
| each(SV* self_sv) |
| 265 |
|
| PPCODE: |
| 266 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 267 |
|
| int16_t out_key, out_value; |
| 268 |
0 |
▶ | if (shm_i16_each(h, &out_key, &out_value)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (shm_i16_each(h, &out_key, &out_value)) { |
0 |
0 |
0 |
|
| 269 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 270 |
0 |
▶ | mXPUSHi(out_key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(out_key); |
0 |
0 |
0 |
|
| 271 |
0 |
▶ | mXPUSHi(out_value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(out_value); |
0 |
0 |
0 |
|
| 272 |
0 |
| XSRETURN(2); |
| 273 |
|
| } |
| 274 |
0 |
| shm_i16_flush_deferred(h); |
| 275 |
0 |
| XSRETURN_EMPTY; |
| 276 |
|
| |
| 277 |
|
| void |
| 278 |
|
| iter_reset(SV* self_sv) |
| 279 |
|
| CODE: |
| 280 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 281 |
0 |
| shm_i16_iter_reset(h); |
| 282 |
0 |
| shm_i16_flush_deferred(h); |
| 283 |
|
| |
| 284 |
|
| void |
| 285 |
|
| clear(SV* self_sv) |
| 286 |
|
| CODE: |
| 287 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 288 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 289 |
1 |
| shm_i16_clear(h); |
| 290 |
|
| |
| 291 |
|
| SV* |
| 292 |
|
| to_hash(SV* self_sv) |
| 293 |
|
| CODE: |
| 294 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 295 |
3 |
| SV* raw = sv_2mortal(newSV(1)); |
| 296 |
3 |
| SSize_t n = 0, nraw = 0; |
| 297 |
3 |
▶ | uint32_t ns = h->shard_handles ? h->num_shards : 1; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t ns = h->shard_handles ? h->num_shards : 1; |
1 |
2 |
3 |
|
| 298 |
3 |
| ENTER; |
| 299 |
9 |
▶ | for (uint32_t si = 0; si < ns; si++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (uint32_t si = 0; si < ns; si++) { |
6 |
3 |
9 |
|
| 300 |
6 |
▶ | ShmHandle *sh = h->shard_handles ? h->shard_handles[si] : h; |
Branch: 1 branch
| Branch | True | False | Total |
| ShmHandle *sh = h->shard_handles ? h->shard_handles[si] : h; |
4 |
2 |
6 |
|
| 301 |
6 |
| ShmHeader *hdr = sh->hdr; |
| 302 |
6 |
| ShmNodeI16 *nodes = (ShmNodeI16 *)sh->nodes; |
| 303 |
6 |
| RDLOCK_GUARD(sh); |
| 304 |
6 |
▶ | uint32_t now = sh->expires_at ? shm_now() : 0, left = hdr->size; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = sh->expires_at ? shm_now() : 0, left = hdr->size; |
5 |
1 |
6 |
|
| 305 |
6 |
▶ | IV *r = (IV *)SvGROW(raw, (nraw + 2 * (STRLEN)left) * sizeof(IV) + 1); |
Branch: 2 branches
| Branch | True | False | Total |
| IV *r = (IV *)SvGROW(raw, (nraw + 2 * (STRLEN)left) * sizeof(IV) + 1); |
6 |
0 |
6 |
| IV *r = (IV *)SvGROW(raw, (nraw + 2 * (STRLEN)left) * sizeof(IV) + 1); |
6 |
0 |
6 |
|
| 306 |
149 |
▶ | for (uint32_t i = 0; i < hdr->table_cap && left; i++) { |
Branch: 2 branches
| Branch | True | False | Total |
| for (uint32_t i = 0; i < hdr->table_cap && left; i++) { |
144 |
5 |
149 |
| for (uint32_t i = 0; i < hdr->table_cap && left; i++) { |
143 |
1 |
144 |
|
| 307 |
143 |
▶ | if (SHM_IS_LIVE(sh->states[i]) && !SHM_IS_EXPIRED(sh, i, now)) { |
Branch: 4 branches
| Branch | True | False | Total |
| if (SHM_IS_LIVE(sh->states[i]) && !SHM_IS_EXPIRED(sh, i, now)) { |
95 |
48 |
143 |
| if (SHM_IS_LIVE(sh->states[i]) && !SHM_IS_EXPIRED(sh, i, now)) { |
90 |
5 |
95 |
| if (SHM_IS_LIVE(sh->states[i]) && !SHM_IS_EXPIRED(sh, i, now)) { |
90 |
0 |
90 |
| if (SHM_IS_LIVE(sh->states[i]) && !SHM_IS_EXPIRED(sh, i, now)) { |
88 |
2 |
90 |
|
| 308 |
93 |
| r[nraw++] = (IV)nodes[i].key; |
| 309 |
93 |
| r[nraw++] = (IV)__atomic_load_n(&nodes[i].value, __ATOMIC_RELAXED); |
| 310 |
93 |
| n++; left--; |
| 311 |
|
| } |
| 312 |
|
| } |
| 313 |
|
| } |
| 314 |
3 |
| LEAVE; |
| 315 |
|
| |
| 316 |
3 |
| RETVAL = shm_copies_to_hashref(aTHX_ raw, NULL, NULL, n); |
| 317 |
|
| OUTPUT: |
| 318 |
|
| RETVAL |
| 319 |
|
| |
| 320 |
|
| SV* |
| 321 |
|
| get_or_set(SV* self_sv, int16_t key, int16_t default_value) |
| 322 |
|
| CODE: |
| 323 |
6 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
6 |
6 |
|
| 324 |
6 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
5 |
1 |
6 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
4 |
5 |
|
| 325 |
|
| int16_t out; |
| 326 |
4 |
| int rc = shm_i16_get_or_set(h, key, default_value, &out); |
| 327 |
4 |
▶ | if (!rc) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!rc) XSRETURN_UNDEF; |
1 |
3 |
4 |
|
| 328 |
3 |
| RETVAL = newSViv(out); |
| 329 |
|
| OUTPUT: |
| 330 |
|
| RETVAL |
| 331 |
|
| |
| 332 |
|
| bool |
| 333 |
|
| put_ttl(SV* self_sv, int16_t key, int16_t value, SV* ttl_sec_sv) |
| 334 |
|
| CODE: |
| 335 |
42 |
| uint32_t ttl_sec = shm_u32_arg(aTHX_ ttl_sec_sv, "ttl", "Data::HashMap::Shared::I16", 0); |
| 336 |
41 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
41 |
41 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
41 |
41 |
|
| 337 |
41 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
40 |
1 |
41 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
39 |
40 |
|
| 338 |
39 |
▶ | REQUIRE_TTL(h); |
Branch: 2 branches
| Branch | True | False | Total |
| REQUIRE_TTL(h); |
3 |
36 |
39 |
| REQUIRE_TTL(h); |
1 |
38 |
39 |
|
| 339 |
38 |
▶ | RETVAL = shm_i16_put_ttl(h, key, value, (uint32_t)ttl_sec); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_put_ttl(h, key, value, (uint32_t)ttl_sec); |
38 |
0 |
38 |
|
| 340 |
|
| OUTPUT: |
| 341 |
|
| RETVAL |
| 342 |
|
| |
| 343 |
|
| UV |
| 344 |
|
| max_size(SV* self_sv) |
| 345 |
|
| CODE: |
| 346 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 347 |
0 |
| RETVAL = (UV)shm_i16_max_size(h); |
| 348 |
|
| OUTPUT: |
| 349 |
|
| RETVAL |
| 350 |
|
| |
| 351 |
|
| UV |
| 352 |
|
| ttl(SV* self_sv) |
| 353 |
|
| CODE: |
| 354 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 355 |
0 |
▶ | RETVAL = (UV)shm_i16_ttl(h); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)shm_i16_ttl(h); |
0 |
0 |
0 |
|
| 356 |
|
| OUTPUT: |
| 357 |
|
| RETVAL |
| 358 |
|
| |
| 359 |
|
| SV* |
| 360 |
|
| take(SV* self_sv, int16_t key) |
| 361 |
|
| CODE: |
| 362 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 363 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 364 |
|
| int16_t out_value; |
| 365 |
0 |
▶ | if (!shm_i16_take(h, key, &out_value)) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_take(h, key, &out_value)) XSRETURN_UNDEF; |
0 |
0 |
0 |
|
| 366 |
0 |
| RETVAL = newSViv(out_value); |
| 367 |
|
| OUTPUT: |
| 368 |
|
| RETVAL |
| 369 |
|
| |
| 370 |
|
| void |
| 371 |
|
| pop(SV* self_sv) |
| 372 |
|
| PPCODE: |
| 373 |
9 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
9 |
9 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
9 |
9 |
|
| 374 |
9 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
8 |
1 |
9 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
7 |
8 |
|
| 375 |
|
| int16_t out_key; |
| 376 |
|
| int16_t out_val; |
| 377 |
7 |
▶ | if (!shm_i16_pop(h, &out_key, &out_val)) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_pop(h, &out_key, &out_val)) XSRETURN_EMPTY; |
3 |
4 |
7 |
|
| 378 |
4 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
4 |
4 |
|
| 379 |
4 |
| mPUSHi(out_key); |
| 380 |
4 |
| mPUSHi(out_val); |
| 381 |
|
| |
| 382 |
|
| void |
| 383 |
|
| shift(SV* self_sv) |
| 384 |
|
| PPCODE: |
| 385 |
8 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
8 |
8 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
8 |
8 |
|
| 386 |
8 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
7 |
1 |
8 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
6 |
7 |
|
| 387 |
|
| int16_t out_key; |
| 388 |
|
| int16_t out_val; |
| 389 |
6 |
▶ | if (!shm_i16_shift(h, &out_key, &out_val)) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_shift(h, &out_key, &out_val)) XSRETURN_EMPTY; |
3 |
3 |
6 |
|
| 390 |
3 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
3 |
3 |
|
| 391 |
3 |
| mPUSHi(out_key); |
| 392 |
3 |
| mPUSHi(out_val); |
| 393 |
|
| |
| 394 |
|
| void |
| 395 |
|
| drain(SV* self_sv, SV* limit_sv) |
| 396 |
|
| PPCODE: |
| 397 |
2 |
| UV limit = shm_count_arg(aTHX_ limit_sv, "drain limit", "Data::HashMap::Shared::I16"); |
| 398 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 399 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 400 |
|
| /* Only as many as the map can yield: limit sizes the allocation. */ |
| 401 |
|
| { |
| 402 |
0 |
| UV avail = (UV)shm_i16_size(h); |
| 403 |
0 |
▶ | if (limit > avail) limit = avail; |
Branch: 1 branch
| Branch | True | False | Total |
| if (limit > avail) limit = avail; |
0 |
0 |
0 |
|
| 404 |
0 |
▶ | if (limit > UINT32_MAX) limit = UINT32_MAX; |
Branch: 1 branch
| Branch | True | False | Total |
| if (limit > UINT32_MAX) limit = UINT32_MAX; |
0 |
0 |
0 |
|
| 405 |
|
| } |
| 406 |
0 |
▶ | if (limit == 0) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (limit == 0) XSRETURN_EMPTY; |
0 |
0 |
0 |
|
| 407 |
|
| shm_i16_drain_entry *entries; |
| 408 |
0 |
▶ | Newxz(entries, limit, shm_i16_drain_entry); |
Branch: 1 branch
| Branch | True | False | Total |
| Newxz(entries, limit, shm_i16_drain_entry); |
0 |
0 |
0 |
|
| 409 |
|
| |
| 410 |
0 |
| SAVEFREEPV(entries); |
| 411 |
0 |
| char *buf = NULL; uint32_t buf_cap = 0; |
| 412 |
0 |
| uint32_t n = shm_i16_drain(h, (uint32_t)limit, entries, &buf, &buf_cap); |
| 413 |
0 |
▶ | if (buf) SAVEDESTRUCTOR_X(shm_free_cleanup, buf); |
Branch: 1 branch
| Branch | True | False | Total |
| if (buf) SAVEDESTRUCTOR_X(shm_free_cleanup, buf); |
0 |
0 |
0 |
|
| 414 |
|
| |
| 415 |
0 |
▶ | EXTEND(SP, (SSize_t)n * 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, (SSize_t)n * 2); |
0 |
0 |
0 |
|
| 416 |
0 |
▶ | for (uint32_t i = 0; i < n; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (uint32_t i = 0; i < n; i++) { |
0 |
0 |
0 |
|
| 417 |
0 |
| mPUSHi(entries[i].key); |
| 418 |
0 |
| mPUSHi(entries[i].value); |
| 419 |
|
| } |
| 420 |
|
| |
| 421 |
|
| |
| 422 |
|
| UV |
| 423 |
|
| flush_expired(SV* self_sv) |
| 424 |
|
| CODE: |
| 425 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 426 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 427 |
1 |
▶ | RETVAL = (UV)shm_i16_flush_expired(h); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = (UV)shm_i16_flush_expired(h); |
0 |
1 |
1 |
|
| 428 |
|
| OUTPUT: |
| 429 |
|
| RETVAL |
| 430 |
|
| |
| 431 |
|
| void |
| 432 |
|
| flush_expired_partial(SV* self_sv, SV* limit_sv) |
| 433 |
|
| PPCODE: |
| 434 |
16 |
| uint32_t limit = shm_u32_arg(aTHX_ limit_sv, "limit", "Data::HashMap::Shared::I16", 0); |
| 435 |
15 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
15 |
15 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
15 |
15 |
|
| 436 |
15 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
14 |
1 |
15 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
13 |
14 |
|
| 437 |
13 |
| int done = 0; |
| 438 |
13 |
| uint32_t flushed = shm_i16_flush_expired_partial(h, (uint32_t)limit, &done); |
| 439 |
13 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
13 |
13 |
|
| 440 |
13 |
| mPUSHu(flushed); |
| 441 |
13 |
| mPUSHi(done); |
| 442 |
|
| |
| 443 |
|
| UV |
| 444 |
|
| mmap_size(SV* self_sv) |
| 445 |
|
| CODE: |
| 446 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 447 |
0 |
| RETVAL = (UV)shm_i16_mmap_size(h); |
| 448 |
|
| OUTPUT: |
| 449 |
|
| RETVAL |
| 450 |
|
| |
| 451 |
|
| bool |
| 452 |
|
| touch(SV* self_sv, int16_t key) |
| 453 |
|
| CODE: |
| 454 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 455 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 456 |
0 |
▶ | RETVAL = shm_i16_touch(h, key); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_touch(h, key); |
0 |
0 |
0 |
|
| 457 |
|
| OUTPUT: |
| 458 |
|
| RETVAL |
| 459 |
|
| |
| 460 |
|
| bool |
| 461 |
|
| reserve(SV* self_sv, SV* target_sv) |
| 462 |
|
| CODE: |
| 463 |
4 |
| uint32_t target = shm_u32_arg(aTHX_ target_sv, "target", "Data::HashMap::Shared::I16", 0); |
| 464 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 465 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 466 |
1 |
▶ | RETVAL = shm_i16_reserve(h, (uint32_t)target); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_reserve(h, (uint32_t)target); |
1 |
0 |
1 |
|
| 467 |
|
| OUTPUT: |
| 468 |
|
| RETVAL |
| 469 |
|
| |
| 470 |
|
| UV |
| 471 |
|
| stat_evictions(SV* self_sv) |
| 472 |
|
| CODE: |
| 473 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 474 |
0 |
| RETVAL = (UV)shm_i16_stat_evictions(h); |
| 475 |
|
| OUTPUT: |
| 476 |
|
| RETVAL |
| 477 |
|
| |
| 478 |
|
| UV |
| 479 |
|
| stat_expired(SV* self_sv) |
| 480 |
|
| CODE: |
| 481 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 482 |
0 |
| RETVAL = (UV)shm_i16_stat_expired(h); |
| 483 |
|
| OUTPUT: |
| 484 |
|
| RETVAL |
| 485 |
|
| |
| 486 |
|
| UV |
| 487 |
|
| stat_recoveries(SV* self_sv) |
| 488 |
|
| CODE: |
| 489 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 490 |
0 |
| RETVAL = (UV)shm_i16_stat_recoveries(h); |
| 491 |
|
| OUTPUT: |
| 492 |
|
| RETVAL |
| 493 |
|
| |
| 494 |
|
| UV |
| 495 |
|
| compact(SV* self_sv) |
| 496 |
|
| CODE: |
| 497 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 498 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 499 |
0 |
| RETVAL = (UV)shm_i16_compact(h); |
| 500 |
|
| OUTPUT: |
| 501 |
|
| RETVAL |
| 502 |
|
| |
| 503 |
|
| UV |
| 504 |
|
| arena_used(SV* self_sv) |
| 505 |
|
| CODE: |
| 506 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 507 |
0 |
| RETVAL = (UV)shm_i16_arena_used(h); |
| 508 |
|
| OUTPUT: |
| 509 |
|
| RETVAL |
| 510 |
|
| |
| 511 |
|
| UV |
| 512 |
|
| arena_cap(SV* self_sv) |
| 513 |
|
| CODE: |
| 514 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 515 |
0 |
| RETVAL = (UV)shm_i16_arena_cap(h); |
| 516 |
|
| OUTPUT: |
| 517 |
|
| RETVAL |
| 518 |
|
| |
| 519 |
|
| bool |
| 520 |
|
| add(SV* self_sv, int16_t key, int16_t value) |
| 521 |
|
| CODE: |
| 522 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 523 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 524 |
2 |
▶ | RETVAL = shm_i16_add(h, key, value); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_add(h, key, value); |
1 |
1 |
2 |
|
| 525 |
|
| OUTPUT: |
| 526 |
|
| RETVAL |
| 527 |
|
| |
| 528 |
|
| bool |
| 529 |
|
| add_ttl(SV* self_sv, int16_t key, int16_t value, SV* ttl_sec_sv) |
| 530 |
|
| CODE: |
| 531 |
6 |
| uint32_t ttl_sec = shm_u32_arg(aTHX_ ttl_sec_sv, "ttl", "Data::HashMap::Shared::I16", 0); |
| 532 |
5 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
5 |
5 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
5 |
5 |
|
| 533 |
5 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
4 |
1 |
5 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
3 |
4 |
|
| 534 |
3 |
▶ | REQUIRE_TTL(h); |
Branch: 2 branches
| Branch | True | False | Total |
| REQUIRE_TTL(h); |
0 |
3 |
3 |
| REQUIRE_TTL(h); |
1 |
2 |
3 |
|
| 535 |
2 |
▶ | RETVAL = shm_i16_add_ttl(h, key, value, (uint32_t)ttl_sec); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_add_ttl(h, key, value, (uint32_t)ttl_sec); |
1 |
1 |
2 |
|
| 536 |
|
| OUTPUT: |
| 537 |
|
| RETVAL |
| 538 |
|
| |
| 539 |
|
| bool |
| 540 |
|
| update(SV* self_sv, int16_t key, int16_t value) |
| 541 |
|
| CODE: |
| 542 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 543 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 544 |
2 |
▶ | RETVAL = shm_i16_update(h, key, value); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_update(h, key, value); |
1 |
1 |
2 |
|
| 545 |
|
| OUTPUT: |
| 546 |
|
| RETVAL |
| 547 |
|
| |
| 548 |
|
| bool |
| 549 |
|
| update_ttl(SV* self_sv, int16_t key, int16_t value, SV* ttl_sec_sv) |
| 550 |
|
| CODE: |
| 551 |
4 |
| uint32_t ttl_sec = shm_u32_arg(aTHX_ ttl_sec_sv, "ttl", "Data::HashMap::Shared::I16", 0); |
| 552 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 553 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 554 |
1 |
▶ | REQUIRE_TTL(h); |
Branch: 2 branches
| Branch | True | False | Total |
| REQUIRE_TTL(h); |
0 |
1 |
1 |
| REQUIRE_TTL(h); |
1 |
0 |
1 |
|
| 555 |
0 |
▶ | RETVAL = shm_i16_update_ttl(h, key, value, (uint32_t)ttl_sec); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_update_ttl(h, key, value, (uint32_t)ttl_sec); |
0 |
0 |
0 |
|
| 556 |
|
| OUTPUT: |
| 557 |
|
| RETVAL |
| 558 |
|
| |
| 559 |
|
| SV* |
| 560 |
|
| swap(SV* self_sv, int16_t key, int16_t value) |
| 561 |
|
| CODE: |
| 562 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 563 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 564 |
|
| int16_t out_value; |
| 565 |
2 |
| int rc = shm_i16_swap(h, key, value, &out_value); |
| 566 |
2 |
▶ | if (rc != 1) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (rc != 1) XSRETURN_UNDEF; |
1 |
1 |
2 |
|
| 567 |
1 |
| RETVAL = newSViv(out_value); |
| 568 |
|
| OUTPUT: |
| 569 |
|
| RETVAL |
| 570 |
|
| |
| 571 |
|
| bool |
| 572 |
|
| cas(SV* self_sv, int16_t key, int16_t expected, int16_t desired) |
| 573 |
|
| CODE: |
| 574 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 575 |
4 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
3 |
1 |
4 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
2 |
3 |
|
| 576 |
2 |
▶ | RETVAL = shm_i16_cas(h, key, expected, desired); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_cas(h, key, expected, desired); |
1 |
1 |
2 |
|
| 577 |
|
| OUTPUT: |
| 578 |
|
| RETVAL |
| 579 |
|
| |
| 580 |
|
| SV* |
| 581 |
|
| cas_take(SV* self_sv, int16_t key, int16_t expected) |
| 582 |
|
| CODE: |
| 583 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 584 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 585 |
|
| int16_t out_value; |
| 586 |
0 |
▶ | if (!shm_i16_cas_take(h, key, expected, &out_value)) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_cas_take(h, key, expected, &out_value)) XSRETURN_UNDEF; |
0 |
0 |
0 |
|
| 587 |
0 |
| RETVAL = newSViv(out_value); |
| 588 |
|
| OUTPUT: |
| 589 |
|
| RETVAL |
| 590 |
|
| |
| 591 |
|
| bool |
| 592 |
|
| persist(SV* self_sv, int16_t key) |
| 593 |
|
| CODE: |
| 594 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 595 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 596 |
1 |
▶ | RETVAL = shm_i16_persist(h, key); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_persist(h, key); |
1 |
0 |
1 |
|
| 597 |
|
| OUTPUT: |
| 598 |
|
| RETVAL |
| 599 |
|
| |
| 600 |
|
| bool |
| 601 |
|
| set_ttl(SV* self_sv, int16_t key, SV* ttl_sec_sv) |
| 602 |
|
| CODE: |
| 603 |
34 |
| uint32_t ttl_sec = shm_u32_arg(aTHX_ ttl_sec_sv, "ttl", "Data::HashMap::Shared::I16", 0); |
| 604 |
33 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
33 |
33 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
33 |
33 |
|
| 605 |
33 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
32 |
1 |
33 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
31 |
32 |
|
| 606 |
31 |
▶ | RETVAL = shm_i16_set_ttl(h, key, (uint32_t)ttl_sec); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_set_ttl(h, key, (uint32_t)ttl_sec); |
31 |
0 |
31 |
|
| 607 |
|
| OUTPUT: |
| 608 |
|
| RETVAL |
| 609 |
|
| |
| 610 |
|
| void |
| 611 |
|
| get_multi(SV* self_sv, ...) |
| 612 |
|
| PPCODE: |
| 613 |
20 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
20 |
20 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
20 |
20 |
|
| 614 |
20 |
| int nkeys = items - 1; |
| 615 |
20 |
▶ | if (nkeys == 0) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (nkeys == 0) XSRETURN_EMPTY; |
0 |
20 |
20 |
|
| 616 |
20 |
▶ | EXTEND(SP, nkeys); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTEND(SP, nkeys); |
20 |
0 |
20 |
| EXTEND(SP, nkeys); |
0 |
20 |
20 |
|
| 617 |
20 |
▶ | if (h->shard_handles) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (h->shard_handles) { |
10 |
10 |
20 |
|
| 618 |
26 |
▶ | for (int i = 0; i < nkeys; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 0; i < nkeys; i++) { |
16 |
10 |
26 |
|
| 619 |
16 |
| int16_t key = (int16_t)SvIV(ST(i + 1)); |
| 620 |
|
| int16_t val; |
| 621 |
16 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
16 |
16 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
16 |
16 |
|
| 622 |
16 |
▶ | if (shm_i16_get(h, key, &val)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (shm_i16_get(h, key, &val)) |
15 |
1 |
16 |
|
| 623 |
15 |
| mPUSHi(val); |
| 624 |
|
| else |
| 625 |
1 |
| PUSHs(&PL_sv_undef); |
| 626 |
|
| } |
| 627 |
|
| } else { |
| 628 |
10 |
| ShmHeader *hdr = h->hdr; |
| 629 |
10 |
| ShmNodeI16 *nodes = (ShmNodeI16 *)h->nodes; |
| 630 |
10 |
| uint8_t *states = h->states; |
| 631 |
10 |
| uint32_t *hashes = NULL; |
| 632 |
10 |
| Newx(hashes, nkeys, uint32_t); |
| 633 |
10 |
| SAVEFREEPV(hashes); |
| 634 |
10 |
| int64_t *keys = NULL; /* read once: a tied key's second FETCH may differ */ |
| 635 |
10 |
| Newx(keys, nkeys, int64_t); |
| 636 |
10 |
| SAVEFREEPV(keys); |
| 637 |
26 |
▶ | for (int i = 0; i < nkeys; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 0; i < nkeys; i++) |
16 |
10 |
26 |
|
| 638 |
16 |
| keys[i] = (int16_t)SvIV(ST(i + 1)); /* FETCH the keys before the lock */ |
| 639 |
10 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
10 |
10 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
10 |
10 |
|
| 640 |
10 |
| RDLOCK_GUARD(h); |
| 641 |
10 |
▶ | uint32_t now = h->expires_at ? shm_now() : 0; |
Branch: 1 branch
| Branch | True | False | Total |
| uint32_t now = h->expires_at ? shm_now() : 0; |
2 |
8 |
10 |
|
| 642 |
10 |
| uint32_t mask = hdr->table_cap - 1; |
| 643 |
26 |
▶ | for (int i = 0; i < nkeys; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 0; i < nkeys; i++) { |
16 |
10 |
26 |
|
| 644 |
16 |
| hashes[i] = shm_hash_int64(keys[i]); |
| 645 |
16 |
| __builtin_prefetch(&states[hashes[i] & mask], 0, 0); |
| 646 |
16 |
| __builtin_prefetch(&nodes[hashes[i] & mask], 0, 0); |
| 647 |
|
| } |
| 648 |
10 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
10 |
10 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
10 |
10 |
|
| 649 |
26 |
▶ | for (int i = 0; i < nkeys; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 0; i < nkeys; i++) { |
16 |
10 |
26 |
|
| 650 |
16 |
| int16_t key = (int16_t)keys[i]; |
| 651 |
16 |
| uint32_t hash = hashes[i]; |
| 652 |
16 |
| uint32_t pos = hash & mask; |
| 653 |
16 |
| uint8_t tag = SHM_MAKE_TAG(hash); |
| 654 |
16 |
| int found = 0; |
| 655 |
16 |
| uint32_t fidx = 0; |
| 656 |
16 |
| int16_t val = 0; |
| 657 |
16 |
▶ | for (uint32_t j = 0; j <= mask; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (uint32_t j = 0; j <= mask; j++) { |
16 |
0 |
16 |
|
| 658 |
16 |
| uint32_t idx = (pos + j) & mask; |
| 659 |
16 |
| uint8_t st = states[idx]; |
| 660 |
16 |
▶ | if (st == SHM_EMPTY) break; |
Branch: 1 branch
| Branch | True | False | Total |
| if (st == SHM_EMPTY) break; |
0 |
16 |
16 |
|
| 661 |
16 |
▶ | if (st != tag) continue; |
Branch: 1 branch
| Branch | True | False | Total |
| if (st != tag) continue; |
0 |
16 |
16 |
|
| 662 |
16 |
▶ | if (nodes[idx].key == key) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (nodes[idx].key == key) { |
16 |
0 |
16 |
|
| 663 |
16 |
▶ | if (h->expires_at && h->expires_at[idx] && now >= h->expires_at[idx]) break; |
Branch: 3 branches
| Branch | True | False | Total |
| if (h->expires_at && h->expires_at[idx] && now >= h->expires_at[idx]) break; |
3 |
13 |
16 |
| if (h->expires_at && h->expires_at[idx] && now >= h->expires_at[idx]) break; |
1 |
2 |
3 |
| if (h->expires_at && h->expires_at[idx] && now >= h->expires_at[idx]) break; |
1 |
0 |
1 |
|
| 664 |
15 |
| val = __atomic_load_n(&nodes[idx].value, __ATOMIC_RELAXED); |
| 665 |
15 |
| fidx = idx; |
| 666 |
15 |
| found = 1; |
| 667 |
15 |
| break; |
| 668 |
|
| } |
| 669 |
|
| } |
| 670 |
16 |
▶ | if (found) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (found) { |
15 |
1 |
16 |
|
| 671 |
15 |
| shm_lru_mark(h, fidx); |
| 672 |
15 |
| mPUSHi(val); |
| 673 |
1 |
| } else PUSHs(&PL_sv_undef); |
| 674 |
16 |
▶ | if (i + 1 < nkeys) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (i + 1 < nkeys) { |
6 |
10 |
16 |
|
| 675 |
6 |
| uint32_t npos = hashes[i + 1] & mask; |
| 676 |
6 |
| __builtin_prefetch(&states[npos], 0, 0); |
| 677 |
6 |
| __builtin_prefetch(&nodes[npos], 0, 0); |
| 678 |
|
| } |
| 679 |
|
| } |
| 680 |
|
| } |
| 681 |
|
| |
| 682 |
|
| void |
| 683 |
|
| get_with_ttl(SV* self_sv, int16_t key) |
| 684 |
|
| PPCODE: |
| 685 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 686 |
|
| int16_t out_value; |
| 687 |
|
| int64_t out_ttl; |
| 688 |
0 |
▶ | if (!shm_i16_get_with_ttl(h, key, &out_value, &out_ttl)) XSRETURN_EMPTY; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!shm_i16_get_with_ttl(h, key, &out_value, &out_ttl)) XSRETURN_EMPTY; |
0 |
0 |
0 |
|
| 689 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 690 |
0 |
| mPUSHi(out_value); |
| 691 |
0 |
▶ | if (out_ttl < 0) PUSHs(&PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| if (out_ttl < 0) PUSHs(&PL_sv_undef); |
0 |
0 |
0 |
|
| 692 |
0 |
| else mPUSHi(out_ttl); |
| 693 |
|
| |
| 694 |
|
| SV* |
| 695 |
|
| stats(SV* self_sv) |
| 696 |
|
| CODE: |
| 697 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 698 |
0 |
| HV *hv = newHV(); |
| 699 |
0 |
| hv_store(hv, "size", 4, newSVuv(shm_i16_size(h)), 0); |
| 700 |
0 |
| hv_store(hv, "capacity", 8, newSVuv(shm_i16_capacity(h)), 0); |
| 701 |
0 |
| hv_store(hv, "max_entries", 11, newSVuv(shm_i16_max_entries(h)), 0); |
| 702 |
0 |
| hv_store(hv, "tombstones", 10, newSVuv(shm_i16_tombstones(h)), 0); |
| 703 |
0 |
| hv_store(hv, "mmap_size", 9, newSVuv(shm_i16_mmap_size(h)), 0); |
| 704 |
0 |
| hv_store(hv, "arena_used", 10, newSVuv(shm_i16_arena_used(h)), 0); |
| 705 |
0 |
| hv_store(hv, "arena_cap", 9, newSVuv(shm_i16_arena_cap(h)), 0); |
| 706 |
0 |
| hv_store(hv, "evictions", 9, newSVuv(shm_i16_stat_evictions(h)), 0); |
| 707 |
0 |
| hv_store(hv, "expired", 7, newSVuv(shm_i16_stat_expired(h)), 0); |
| 708 |
0 |
| hv_store(hv, "recoveries", 10, newSVuv(shm_i16_stat_recoveries(h)), 0); |
| 709 |
0 |
| hv_store(hv, "max_size", 8, newSVuv(shm_i16_max_size(h)), 0); |
| 710 |
0 |
| hv_store(hv, "ttl", 3, newSVuv(shm_i16_ttl(h)), 0); |
| 711 |
0 |
| hv_store(hv, "frozen", 6, newSVuv((UV)shm_is_sealed(h)), 0); |
| 712 |
0 |
▶ | hv_store(hv, "readonly", 8, newSVuv((UV)(h->readonly ? 1 : 0)), 0); |
Branch: 1 branch
| Branch | True | False | Total |
| hv_store(hv, "readonly", 8, newSVuv((UV)(h->readonly ? 1 : 0)), 0); |
0 |
0 |
0 |
|
| 713 |
0 |
| RETVAL = newRV_noinc((SV*)hv); |
| 714 |
|
| OUTPUT: |
| 715 |
|
| RETVAL |
| 716 |
|
| |
| 717 |
|
| UV |
| 718 |
|
| set_multi(SV* self_sv, ...) |
| 719 |
|
| CODE: |
| 720 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 721 |
3 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
2 |
1 |
3 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
|
| 722 |
1 |
▶ | if ((items - 1) % 2 != 0) croak("%s: set_multi requires an even number of arguments (key, value pairs)", shm_class); |
Branch: 1 branch
| Branch | True | False | Total |
| if ((items - 1) % 2 != 0) croak("%s: set_multi requires an even number of arguments (key, value pairs)", shm_class); |
1 |
0 |
1 |
|
| 723 |
0 |
| uint32_t count = 0; |
| 724 |
0 |
▶ | if (h->shard_handles) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (h->shard_handles) { |
0 |
0 |
0 |
|
| 725 |
0 |
▶ | for (int i = 1; i < items; i += 2) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 1; i < items; i += 2) { |
0 |
0 |
0 |
|
| 726 |
0 |
| int16_t _k = (int16_t)SvIV(ST(i)); |
| 727 |
0 |
| int16_t _v = (int16_t)SvIV(ST(i + 1)); |
| 728 |
0 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 729 |
0 |
| count += shm_i16_put(h, _k, _v); |
| 730 |
|
| } |
| 731 |
|
| } else { |
| 732 |
|
| /* Materialize arguments before the lock: a re-entrant FETCH would self-deadlock. */ |
| 733 |
0 |
| int _n = (items - 1) / 2; |
| 734 |
|
| int16_t *_ks, *_vs; |
| 735 |
0 |
▶ | Newx(_ks, _n ? _n : 1, int16_t); SAVEFREEPV(_ks); |
Branch: 1 branch
| Branch | True | False | Total |
| Newx(_ks, _n ? _n : 1, int16_t); SAVEFREEPV(_ks); |
0 |
0 |
0 |
|
| 736 |
0 |
▶ | Newx(_vs, _n ? _n : 1, int16_t); SAVEFREEPV(_vs); |
Branch: 1 branch
| Branch | True | False | Total |
| Newx(_vs, _n ? _n : 1, int16_t); SAVEFREEPV(_vs); |
0 |
0 |
0 |
|
| 737 |
0 |
▶ | for (int i = 1, j = 0; i < items; i += 2, j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 1, j = 0; i < items; i += 2, j++) { |
0 |
0 |
0 |
|
| 738 |
0 |
| _ks[j] = (int16_t)SvIV(ST(i)); |
| 739 |
0 |
| _vs[j] = (int16_t)SvIV(ST(i + 1)); |
| 740 |
|
| } |
| 741 |
0 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 742 |
0 |
| WRSEQ_BEGIN(h); |
| 743 |
0 |
▶ | for (int j = 0; j < _n; j++, shm_sig_check_every(h, (uint32_t)j, SHM_SIG_CHECK_ENTRIES)) |
Branch: 1 branch
| Branch | True | False | Total |
| for (int j = 0; j < _n; j++, shm_sig_check_every(h, (uint32_t)j, SHM_SIG_CHECK_ENTRIES)) |
0 |
0 |
0 |
|
| 744 |
0 |
| count += shm_i16_put_inner(h, _ks[j], _vs[j], SHM_TTL_USE_DEFAULT); |
| 745 |
0 |
| WRSEQ_END(h); |
| 746 |
|
| } |
| 747 |
0 |
▶ | RETVAL = count; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = count; |
0 |
0 |
0 |
|
| 748 |
|
| OUTPUT: |
| 749 |
|
| RETVAL |
| 750 |
|
| |
| 751 |
|
| UV |
| 752 |
|
| remove_multi(SV* self_sv, ...) |
| 753 |
|
| CODE: |
| 754 |
2 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
2 |
2 |
|
| 755 |
2 |
▶ | if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
Branch: 2 branches
| Branch | True | False | Total |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
1 |
2 |
| if (h->readonly || shm_is_sealed(h)) croak("Data::HashMap::Shared::I16: map is frozen (read-only)"); |
1 |
0 |
1 |
|
| 756 |
0 |
| uint32_t count = 0; |
| 757 |
0 |
▶ | if (h->shard_handles) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (h->shard_handles) { |
0 |
0 |
0 |
|
| 758 |
0 |
▶ | for (int i = 1; i < items; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 1; i < items; i++) { |
0 |
0 |
0 |
|
| 759 |
0 |
| int16_t _k = (int16_t)SvIV(ST(i)); |
| 760 |
0 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 761 |
0 |
| count += shm_i16_remove(h, _k); |
| 762 |
|
| } |
| 763 |
|
| } else { |
| 764 |
0 |
| int _n = items - 1; |
| 765 |
|
| int16_t *_ks; |
| 766 |
0 |
▶ | Newx(_ks, _n ? _n : 1, int16_t); SAVEFREEPV(_ks); |
Branch: 1 branch
| Branch | True | False | Total |
| Newx(_ks, _n ? _n : 1, int16_t); SAVEFREEPV(_ks); |
0 |
0 |
0 |
|
| 767 |
0 |
▶ | for (int i = 1, j = 0; i < items; i++, j++) |
Branch: 1 branch
| Branch | True | False | Total |
| for (int i = 1, j = 0; i < items; i++, j++) |
0 |
0 |
0 |
|
| 768 |
0 |
| _ks[j] = (int16_t)SvIV(ST(i)); /* FETCH before the lock */ |
| 769 |
0 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 770 |
0 |
| WRSEQ_BEGIN(h); |
| 771 |
0 |
▶ | for (int j = 0; j < _n; j++, shm_sig_check_every(h, (uint32_t)j, SHM_SIG_CHECK_ENTRIES)) |
Branch: 1 branch
| Branch | True | False | Total |
| for (int j = 0; j < _n; j++, shm_sig_check_every(h, (uint32_t)j, SHM_SIG_CHECK_ENTRIES)) |
0 |
0 |
0 |
|
| 772 |
0 |
| count += shm_i16_remove_inner(h, _ks[j]); |
| 773 |
0 |
▶ | if (count) shm_i16_maybe_shrink(h); |
Branch: 1 branch
| Branch | True | False | Total |
| if (count) shm_i16_maybe_shrink(h); |
0 |
0 |
0 |
|
| 774 |
0 |
| WRSEQ_END(h); |
| 775 |
|
| } |
| 776 |
0 |
▶ | RETVAL = count; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = count; |
0 |
0 |
0 |
|
| 777 |
|
| OUTPUT: |
| 778 |
|
| RETVAL |
| 779 |
|
| |
| 780 |
|
| SV* |
| 781 |
|
| path(SV* self_sv) |
| 782 |
|
| CODE: |
| 783 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 784 |
0 |
▶ | RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef; |
0 |
0 |
0 |
|
| 785 |
|
| OUTPUT: |
| 786 |
|
| RETVAL |
| 787 |
|
| |
| 788 |
|
| bool |
| 789 |
|
| unlink(SV* self_or_class, ...) |
| 790 |
|
| CODE: |
| 791 |
0 |
▶ | if (sv_isobject(self_or_class) && sv_derived_from(self_or_class, "Data::HashMap::Shared::I16")) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (sv_isobject(self_or_class) && sv_derived_from(self_or_class, "Data::HashMap::Shared::I16")) { |
0 |
0 |
0 |
| if (sv_isobject(self_or_class) && sv_derived_from(self_or_class, "Data::HashMap::Shared::I16")) { |
0 |
0 |
0 |
|
| 792 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
0 |
0 |
0 |
|
| 793 |
0 |
▶ | if (h->path) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (h->path) { |
0 |
0 |
0 |
|
| 794 |
0 |
▶ | SHM_TAINT_CHECK("Data::HashMap::Shared::I16->unlink"); |
Branch: 1 branch
| Branch | True | False | Total |
| SHM_TAINT_CHECK("Data::HashMap::Shared::I16->unlink"); |
0 |
0 |
0 |
|
| 795 |
0 |
▶ | REEXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
Branch: 2 branches
| Branch | True | False | Total |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
0 |
0 |
0 |
| REEXTRACT_MAP("Data::HashMap::Shared::I16", self_or_class); |
0 |
0 |
0 |
|
| 796 |
|
| } |
| 797 |
0 |
| RETVAL = shm_unlink_sharded(h); |
| 798 |
|
| } else { |
| 799 |
0 |
▶ | if (items < 2) croak("Usage: Data::HashMap::Shared::I16->unlink($path)"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) croak("Usage: Data::HashMap::Shared::I16->unlink($path)"); |
0 |
0 |
0 |
|
| 800 |
0 |
▶ | SvGETMAGIC(ST(1)); |
Branch: 2 branches
| Branch | True | False | Total |
| SvGETMAGIC(ST(1)); |
0 |
0 |
0 |
| SvGETMAGIC(ST(1)); |
0 |
0 |
0 |
|
| 801 |
0 |
| RETVAL = shm_unlink_path(shm_write_path_arg(aTHX_ ST(1), "path", "Data::HashMap::Shared::I16", "Data::HashMap::Shared::I16->unlink")); |
| 802 |
|
| } |
| 803 |
|
| OUTPUT: |
| 804 |
|
| RETVAL |
| 805 |
|
| |
| 806 |
|
| SV* |
| 807 |
|
| ttl_remaining(SV* self_sv, int16_t key) |
| 808 |
|
| CODE: |
| 809 |
4 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
4 |
4 |
|
| 810 |
4 |
| int64_t remaining = shm_i16_ttl_remaining(h, key); |
| 811 |
4 |
▶ | if (remaining < 0) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (remaining < 0) XSRETURN_UNDEF; |
0 |
4 |
4 |
|
| 812 |
4 |
| RETVAL = newSViv(remaining); |
| 813 |
|
| OUTPUT: |
| 814 |
|
| RETVAL |
| 815 |
|
| |
| 816 |
|
| UV |
| 817 |
|
| capacity(SV* self_sv) |
| 818 |
|
| CODE: |
| 819 |
3 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
3 |
3 |
|
| 820 |
3 |
| RETVAL = (UV)shm_i16_capacity(h); |
| 821 |
|
| OUTPUT: |
| 822 |
|
| RETVAL |
| 823 |
|
| |
| 824 |
|
| UV |
| 825 |
|
| tombstones(SV* self_sv) |
| 826 |
|
| CODE: |
| 827 |
0 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
0 |
0 |
|
| 828 |
0 |
| RETVAL = (UV)shm_i16_tombstones(h); |
| 829 |
|
| OUTPUT: |
| 830 |
|
| RETVAL |
| 831 |
|
| |
| 832 |
|
| SV* |
| 833 |
|
| cursor(SV* self_sv) |
| 834 |
|
| CODE: |
| 835 |
9 |
▶ | EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
Branch: 2 branches
| Branch | True | False | Total |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
9 |
9 |
| EXTRACT_MAP("Data::HashMap::Shared::I16", self_sv); |
0 |
9 |
9 |
|
| 836 |
9 |
| ShmCursor* c = shm_cursor_create(h); |
| 837 |
9 |
▶ | if (!c) croak("%s: failed to allocate a cursor", shm_class); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!c) croak("%s: failed to allocate a cursor", shm_class); |
0 |
9 |
9 |
|
| 838 |
9 |
| c->owner = SvREFCNT_inc(SvRV(self_sv)); |
| 839 |
9 |
| RETVAL = sv_setref_pv(newSV(0), "Data::HashMap::Shared::I16::Cursor", (void*)c); |
| 840 |
|
| OUTPUT: |
| 841 |
|
| RETVAL |
| 842 |
|
| |
| 843 |
|
| MODULE = Data::HashMap::Shared PACKAGE = Data::HashMap::Shared::I16::Cursor |
| 844 |
|
| PROTOTYPES: DISABLE |
| 845 |
|
| |
| 846 |
|
| void |
| 847 |
|
| DESTROY(SV* self_sv) |
| 848 |
|
| CODE: |
| 849 |
9 |
▶ | if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16::Cursor")) return; |
Branch: 2 branches
| Branch | True | False | Total |
| if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16::Cursor")) return; |
9 |
0 |
9 |
| if (!sv_isobject(self_sv) || !sv_derived_from(self_sv, "Data::HashMap::Shared::I16::Cursor")) return; |
0 |
9 |
9 |
|
| 850 |
9 |
| ShmCursor* c = INT2PTR(ShmCursor*, SvIV(SvRV(self_sv))); |
| 851 |
9 |
▶ | if (!c) return; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!c) return; |
0 |
9 |
9 |
|
| 852 |
9 |
▶ | CURSOR_DETACH_IF_MAP_GONE(c, owner, h); |
Branch: 3 branches
| Branch | True | False | Total |
| CURSOR_DETACH_IF_MAP_GONE(c, owner, h); |
9 |
0 |
9 |
| CURSOR_DETACH_IF_MAP_GONE(c, owner, h); |
9 |
0 |
9 |
| CURSOR_DETACH_IF_MAP_GONE(c, owner, h); |
0 |
9 |
9 |
|
| 853 |
9 |
| shm_cursor_destroy(c); |
| 854 |
9 |
▶ | if (h) shm_i16_flush_deferred(h); |
Branch: 1 branch
| Branch | True | False | Total |
| if (h) shm_i16_flush_deferred(h); |
9 |
0 |
9 |
|
| 855 |
9 |
▶ | if (owner) SvREFCNT_dec(owner); |
Branch: 1 branch
| Branch | True | False | Total |
| if (owner) SvREFCNT_dec(owner); |
9 |
0 |
9 |
|
| 856 |
9 |
| sv_setiv(SvRV(self_sv), 0); |
| 857 |
|
| |
| 858 |
|
| void |
| 859 |
|
| next(SV* self_sv) |
| 860 |
|
| PPCODE: |
| 861 |
2 |
▶ | EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
Branch: 4 branches
| Branch | True | False | Total |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
2 |
0 |
2 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
|
| 862 |
|
| int16_t out_key, out_value; |
| 863 |
0 |
▶ | if (shm_i16_cursor_next(c, &out_key, &out_value)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (shm_i16_cursor_next(c, &out_key, &out_value)) { |
0 |
0 |
0 |
|
| 864 |
0 |
▶ | EXTEND(SP, 2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 2); |
0 |
0 |
0 |
|
| 865 |
0 |
▶ | mXPUSHi(out_key); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(out_key); |
0 |
0 |
0 |
|
| 866 |
0 |
▶ | mXPUSHi(out_value); |
Branch: 1 branch
| Branch | True | False | Total |
| mXPUSHi(out_value); |
0 |
0 |
0 |
|
| 867 |
0 |
| XSRETURN(2); |
| 868 |
|
| } |
| 869 |
0 |
| XSRETURN_EMPTY; |
| 870 |
|
| |
| 871 |
|
| void |
| 872 |
|
| reset(SV* self_sv) |
| 873 |
|
| CODE: |
| 874 |
0 |
▶ | EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
Branch: 4 branches
| Branch | True | False | Total |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
|
| 875 |
0 |
| shm_i16_cursor_reset(c); |
| 876 |
|
| |
| 877 |
|
| bool |
| 878 |
|
| seek(SV* self_sv, int16_t key) |
| 879 |
|
| CODE: |
| 880 |
0 |
▶ | EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
Branch: 4 branches
| Branch | True | False | Total |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
| EXTRACT_CURSOR("Data::HashMap::Shared::I16::Cursor", self_sv); |
0 |
0 |
0 |
|
| 881 |
0 |
▶ | RETVAL = shm_i16_cursor_seek(c, key); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = shm_i16_cursor_seek(c, key); |
0 |
0 |
0 |
|
| 882 |
|
| OUTPUT: |
| 883 |
|
| RETVAL |
| 884 |
|
| |