diff options
author | Björn-Egil Dahlberg <[email protected]> | 2017-03-29 10:45:15 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2017-03-29 10:45:15 +0200 |
commit | 53b483cb14c4b3b666eab63f9f09d7ac827f9a7c (patch) | |
tree | 1915ebbd16eee5b1c28b6c5998ab2723827a78af /erts | |
parent | 14683af3f9ec296db455802f04165d1cd260bb70 (diff) | |
parent | d71498ac1bfa204138ec7d7ae9fb97d0ffe071b9 (diff) | |
download | otp-53b483cb14c4b3b666eab63f9f09d7ac827f9a7c.tar.gz otp-53b483cb14c4b3b666eab63f9f09d7ac827f9a7c.tar.bz2 otp-53b483cb14c4b3b666eab63f9f09d7ac827f9a7c.zip |
Merge branch 'egil/erts/fix-copy-sharing-assert'
* egil/erts/fix-copy-sharing-assert:
erts: Fix faulty assert for refs in copy sharing
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/copy.c | 5 | ||||
-rw-r--r-- | erts/emulator/beam/erl_term.h | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c index e567eabc82..264ba89e8b 100644 --- a/erts/emulator/beam/copy.c +++ b/erts/emulator/beam/copy.c @@ -286,11 +286,6 @@ do { \ (dst) = result; \ } while(0) -#define BOXED_VISITED_MASK ((Eterm) 3) -#define BOXED_VISITED ((Eterm) 1) -#define BOXED_SHARED_UNPROCESSED ((Eterm) 2) -#define BOXED_SHARED_PROCESSED ((Eterm) 3) - #define COUNT_OFF_HEAP (0) /* diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index a602a8f7c6..097d580d99 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -873,6 +873,12 @@ typedef union { ErtsORefThing o; } ErtsRefThing; +/* for copy sharing */ +#define BOXED_VISITED_MASK ((Eterm) 3) +#define BOXED_VISITED ((Eterm) 1) +#define BOXED_SHARED_UNPROCESSED ((Eterm) 2) +#define BOXED_SHARED_PROCESSED ((Eterm) 3) + #define ERTS_REF_THING_SIZE (sizeof(ErtsORefThing)/sizeof(Uint)) #define ERTS_MAGIC_REF_THING_SIZE (sizeof(ErtsMRefThing)/sizeof(Uint)) #define ERTS_MAX_INTERNAL_REF_SIZE (sizeof(ErtsRefThing)/sizeof(Uint)) @@ -888,9 +894,14 @@ typedef union { # define is_ref_thing_header(x) ((x) == ERTS_REF_THING_HEADER) -#define is_ordinary_ref_thing(x) \ - (ASSERT(is_ref_thing_header(*((Eterm *)(x)))), \ +#ifdef SHCOPY +#define is_ordinary_ref_thing(x) \ + (((ErtsRefThing *) (x))->o.marker == ERTS_ORDINARY_REF_MARKER) +#else +#define is_ordinary_ref_thing(x) \ + (ASSERT(is_ref_thing_header((*((Eterm *)(x))) & ~BOXED_VISITED_MASK)), \ ((ErtsRefThing *) (x))->o.marker == ERTS_ORDINARY_REF_MARKER) +#endif #define is_magic_ref_thing(x) \ (!is_ordinary_ref_thing((x))) |