diff options
author | Sverker Eriksson <sverker@erlang.org> | 2021-03-29 20:20:43 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2021-04-09 14:17:35 +0200 |
commit | 24d7fa01c67dd00b134cc5f8c5779d8513f8dd0f (patch) | |
tree | fd41503032409ae618fadc6afcb81833eddad27c | |
parent | 2f5be5d1e07072fcf43e92fcd1779618e7fa7a9f (diff) | |
download | erlang-24d7fa01c67dd00b134cc5f8c5779d8513f8dd0f.tar.gz |
Refactor away upsz as pointer argument
-rw-r--r-- | erts/emulator/beam/erl_map.c | 8 | ||||
-rw-r--r-- | erts/emulator/beam/erl_map.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c index 8ec87cce4b..4f9d9ce287 100644 --- a/erts/emulator/beam/erl_map.c +++ b/erts/emulator/beam/erl_map.c @@ -2375,7 +2375,7 @@ Eterm erts_hashmap_insert(Process *p, Uint32 hx, Eterm key, Eterm value, if (size) { /* We are putting a new value (under a new or existing key) */ hp = HAlloc(p, size); - res = erts_hashmap_insert_up(hp, key, value, &upsz, &stack); + res = erts_hashmap_insert_up(hp, key, value, upsz, &stack); } else { /* We are putting the same key-value */ @@ -2517,7 +2517,7 @@ unroll: } Eterm erts_hashmap_insert_up(Eterm *hp, Eterm key, Eterm value, - Uint *update_size, ErtsEStack *sp) { + Uint update_size, ErtsEStack *sp) { Eterm node, *ptr, hdr; Eterm res; Eterm *nhp = NULL; @@ -2562,7 +2562,7 @@ Eterm erts_hashmap_insert_up(Eterm *hp, Eterm key, Eterm value, nhp = hp; n = HAMT_HEAD_ARRAY_SZ - 2; *hp++ = MAP_HEADER_HAMT_HEAD_ARRAY; ptr++; - *hp++ = (*ptr++) + *update_size; + *hp++ = (*ptr++) + update_size; while(n--) { *hp++ = *ptr++; } nhp[slot+2] = res; res = make_hashmap(nhp); @@ -2590,7 +2590,7 @@ Eterm erts_hashmap_insert_up(Eterm *hp, Eterm key, Eterm value, hval = MAP_HEADER_VAL(hdr); nhp = hp; *hp++ = MAP_HEADER_HAMT_HEAD_BITMAP(hval | bp); ptr++; - *hp++ = (*ptr++) + *update_size; + *hp++ = (*ptr++) + update_size; n -= slot; while(slot--) { *hp++ = *ptr++; } diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h index d587273ec7..980cf246c4 100644 --- a/erts/emulator/beam/erl_map.h +++ b/erts/emulator/beam/erl_map.h @@ -88,7 +88,7 @@ Eterm erts_hashmap_insert(Process *p, Uint32 hx, Eterm key, Eterm value, int erts_hashmap_insert_down(Uint32 hx, Eterm key, Eterm value, Eterm node, Uint *sz, Uint *upsz, struct ErtsEStack_ *sp, int is_update); Eterm erts_hashmap_insert_up(Eterm *hp, Eterm key, Eterm value, - Uint *upsz, struct ErtsEStack_ *sp); + Uint upsz, struct ErtsEStack_ *sp); int erts_validate_and_sort_flatmap(flatmap_t* map); void hashmap_iterator_init(struct ErtsWStack_* s, Eterm node, int reverse); |