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