diff options
author | Rickard Green <[email protected]> | 2017-02-06 17:06:40 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-02-06 17:06:40 +0100 |
commit | e3f2ac81039f713d2b685130e8709274b87371ac (patch) | |
tree | e44de180b8ad7bb0e760d9b466e05b1dd405cdba /erts/emulator/beam/erl_vm.h | |
parent | 77a9b8c6fe331761a89d48419ee2200ba5377e49 (diff) | |
parent | c95e126ab3d4fbf38ef6cb9694da079d895ffa68 (diff) | |
download | otp-e3f2ac81039f713d2b685130e8709274b87371ac.tar.gz otp-e3f2ac81039f713d2b685130e8709274b87371ac.tar.bz2 otp-e3f2ac81039f713d2b685130e8709274b87371ac.zip |
Merge branch 'maint'
* maint:
Use a hole-marker that cannot be mistaken for a valid term on the heap
Diffstat (limited to 'erts/emulator/beam/erl_vm.h')
-rw-r--r-- | erts/emulator/beam/erl_vm.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h index d88cafc5bf..5366ee3644 100644 --- a/erts/emulator/beam/erl_vm.h +++ b/erts/emulator/beam/erl_vm.h @@ -110,8 +110,21 @@ #define HeapWordsLeft(p) (HEAP_LIMIT(p) - HEAP_TOP(p)) #if defined(DEBUG) || defined(CHECK_FOR_HOLES) -# define ERTS_HOLE_MARKER (((0xdeadbeef << 24) << 8) | 0xdeadbeef) -#endif /* egil: 32-bit ? */ + +/* + * ERTS_HOLE_MARKER must *not* be mistaken for a valid term + * on the heap... + */ +# ifdef ARCH_64 +# define ERTS_HOLE_MARKER \ + make_catch(UWORD_CONSTANT(0xdeadbeaf00000000) >> _TAG_IMMED2_SIZE) +/* Will (at the time of writing) appear as 0xdeadbeaf0000001b */ +# else +# define ERTS_HOLE_MARKER \ + make_catch(UWORD_CONSTANT(0xdead0000) >> _TAG_IMMED2_SIZE) +/* Will (at the time of writing) appear as 0xdead001b */ +# endif +#endif /* * Allocate heap memory on the ordinary heap, NEVER in a heap |