File 0541-erts-Cleanup-ErtsMagicIndirectionWord.patch of Package erlang

From 7034c725744e1338e71c5e8cdb3b6a4f6dd68d69 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Fri, 26 Aug 2022 22:19:57 +0200
Subject: [PATCH 1/5] erts: Cleanup ErtsMagicIndirectionWord

---
 erts/emulator/beam/erl_binary.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h
index df18e6d835..2eec56ef2c 100644
--- a/erts/emulator/beam/erl_binary.h
+++ b/erts/emulator/beam/erl_binary.h
@@ -281,14 +281,7 @@ BIF_RETTYPE erts_list_to_binary_bif(Process *p, Eterm arg, Export *bif);
 BIF_RETTYPE erts_binary_part(Process *p, Eterm binary, Eterm epos, Eterm elen);
 
 
-typedef union {
-    /*
-     * These two are almost always of
-     * the same size, but when fallback
-     * atomics are used they might
-     * differ in size.
-     */
-    erts_atomic_t smp_atomic_word;
+typedef struct {
     erts_atomic_t atomic_word;
 } ErtsMagicIndirectionWord;
 
@@ -562,7 +555,7 @@ erts_binary_to_magic_indirection(Binary *bp)
     ASSERT(bp->intern.flags & BIN_FLAG_MAGIC);
     ASSERT(ERTS_MAGIC_BIN_ATYPE(bp) == ERTS_ALC_T_MINDIRECTION);
     mip = (ErtsMagicIndirectionWord*)ERTS_MAGIC_BIN_UNALIGNED_DATA(bp);
-    return &mip->smp_atomic_word;
+    return &mip->atomic_word;
 }
 
 #endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
-- 
2.35.3

openSUSE Build Service is sponsored by