File 3482-Refactor-away-some-obsolete-halfword-macros.patch of Package erlang

From 2f5be5d1e07072fcf43e92fcd1779618e7fa7a9f Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Mon, 29 Mar 2021 20:31:09 +0200
Subject: [PATCH 2/3] Refactor away some obsolete halfword macros

---
 erts/emulator/beam/erl_map.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index ce17cd9163..8ec87cce4b 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -2399,11 +2399,10 @@ int erts_hashmap_insert_down(Uint32 hx, Eterm key, Eterm value, Eterm node, Uint
     Uint32 ix, cix, bp, hval, chx;
     Uint slot, lvl = 0, clvl;
     Uint size = 0, n = 0;
-    DeclareTmpHeapNoproc(th,2);
+    Eterm th[2];
 
     *update_size = 1;
 
-    UseTmpHeapNoproc(2);
     for (;;) {
 	switch(primary_tag(node)) {
 	    case TAG_PRIMARY_LIST: /* LEAF NODE [K|V] */
@@ -2418,7 +2417,6 @@ int erts_hashmap_insert_down(Uint32 hx, Eterm key, Eterm value, Eterm node, Uint
 		    goto unroll;
 		}
 		if (is_update) {
-                    UnUseTmpHeapNoproc(2);
 		    return 0;
 		}
 		goto insert_subnodes;
@@ -2451,7 +2449,6 @@ int erts_hashmap_insert_down(Uint32 hx, Eterm key, Eterm value, Eterm node, Uint
 
                         if (!(bp & hval)) { /* not occupied */
                             if (is_update) {
-				UnUseTmpHeapNoproc(2);
                                 return 0;
                             }
                             size += HAMT_NODE_BITMAP_SZ(n+1);
@@ -2483,7 +2480,6 @@ int erts_hashmap_insert_down(Uint32 hx, Eterm key, Eterm value, Eterm node, Uint
 			}
 			/* not occupied */
 			if (is_update) {
-                            UnUseTmpHeapNoproc(2);
 			    return 0;
 			}
 			size += HAMT_HEAD_BITMAP_SZ(n+1);
@@ -2517,7 +2513,6 @@ insert_subnodes:
 
 unroll:
     *sz = size + /* res cons */ 2;
-    UnUseTmpHeapNoproc(2);
     return 1;
 }
 
-- 
2.26.2

openSUSE Build Service is sponsored by