File 3483-Refactor-away-upsz-as-pointer-argument.patch of Package erlang

From 24d7fa01c67dd00b134cc5f8c5779d8513f8dd0f Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Mon, 29 Mar 2021 20:20:43 +0200
Subject: [PATCH 3/3] Refactor away upsz as pointer argument

---
 erts/emulator/beam/erl_map.c | 8 ++++----
 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);
-- 
2.26.2

openSUSE Build Service is sponsored by