summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-11 21:51:35 +0200
committerGitHub <noreply@github.com>2021-05-11 21:51:35 +0200
commit0f334e60f2d4fd7c9ab7dd0feae12e6e682755da (patch)
treeebdf22c631621287d5cfe9fc0c86de12bc09cf9f /core
parent048abb50aa8792958977cf398acadd5e9a1974db (diff)
parented11756d26c75864b40b2645d4f35ead20330876 (diff)
Merge pull request #48646 from akien-mga/gdnative-signal-callable-32bit
GDNative: Fix size mismatch on 32-bit platforms for Signal and Callable
Diffstat (limited to 'core')
-rw-r--r--core/variant/callable.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/variant/callable.h b/core/variant/callable.h
index d91bebfa5f..20d0804292 100644
--- a/core/variant/callable.h
+++ b/core/variant/callable.h
@@ -44,9 +44,9 @@ class CallableCustom;
// is required. It is designed for the standard case (object and method)
// but can be optimized or customized.
+// Enforce 16 bytes with `alignas` to avoid arch-specific alignment issues on x86 vs armv7.
class Callable {
- //needs to be max 16 bytes in 64 bits
- StringName method;
+ alignas(8) StringName method;
union {
uint64_t object = 0;
CallableCustom *custom;
@@ -138,8 +138,9 @@ public:
// be put inside a Variant, but it is not
// used by the engine itself.
+// Enforce 16 bytes with `alignas` to avoid arch-specific alignment issues on x86 vs armv7.
class Signal {
- StringName name;
+ alignas(8) StringName name;
ObjectID object;
public: