aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-11-15 20:24:16 +0100
committerSverker Eriksson <[email protected]>2012-11-15 20:24:16 +0100
commit8f1bd655d8bbfc80efb082daca495c19aff02f3d (patch)
tree89f727c2102c4fd09dbb870c0003cef266ad0946 /erts/emulator/beam/erl_alloc_util.h
parent379fc29e02f91193a9bc41454f9bf288ca4a7989 (diff)
downloadotp-8f1bd655d8bbfc80efb082daca495c19aff02f3d.tar.gz
otp-8f1bd655d8bbfc80efb082daca495c19aff02f3d.tar.bz2
otp-8f1bd655d8bbfc80efb082daca495c19aff02f3d.zip
erts: Enable new header scheme without super alignment on 64-bit
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.h')
-rw-r--r--erts/emulator/beam/erl_alloc_util.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h
index 06a5a5a346..e3dde2d54c 100644
--- a/erts/emulator/beam/erl_alloc_util.h
+++ b/erts/emulator/beam/erl_alloc_util.h
@@ -222,11 +222,18 @@ erts_aint32_t erts_alcu_fix_alloc_shrink(Allctr_t *, erts_aint32_t);
#define CARRIER_SZ_MASK UNIT_MASK
-#if HAVE_SUPER_ALIGNED_MB_CARRIERS
-# define CARRIER_OFFSET_BITS 13
-# define CARRIER_OFFSET_SHIFT (sizeof(UWord)*8 - CARRIER_OFFSET_BITS)
-# define CARRIER_OFFSET_MASK (~((UWord)0) << CARRIER_OFFSET_SHIFT)
-# define MBC_ABLK_SZ_MASK (~CARRIER_OFFSET_MASK & ~FLG_MASK)
+#ifdef ARCH_64
+# define MBC_ABLK_OFFSET_BITS 24
+#elif HAVE_SUPER_ALIGNED_MB_CARRIERS
+# define MBC_ABLK_OFFSET_BITS 13
+#else
+# define MBC_ABLK_OFFSET_BITS 0 /* no carrier offset in block header */
+#endif
+
+#if MBC_ABLK_OFFSET_BITS
+# define MBC_ABLK_OFFSET_SHIFT (sizeof(UWord)*8 - MBC_ABLK_OFFSET_BITS)
+# define MBC_ABLK_OFFSET_MASK (~((UWord)0) << MBC_ABLK_OFFSET_SHIFT)
+# define MBC_ABLK_SZ_MASK (~MBC_ABLK_OFFSET_MASK & ~FLG_MASK)
#else
# define MBC_ABLK_SZ_MASK (~FLG_MASK)
#endif
@@ -257,13 +264,14 @@ typedef struct {
typedef struct {
UWord bhdr;
-#if !HAVE_SUPER_ALIGNED_MB_CARRIERS
+#if !MBC_ABLK_OFFSET_BITS
Carrier_t *carrier;
-#endif
+#else
union {
Carrier_t *carrier; /* if free */
char udata__[1]; /* if allocated */
}u;
+#endif
} Block_t;
typedef UWord FreeBlkFtr_t; /* Footer of a free block */