diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-24 12:27:22 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-24 12:27:22 +0200 |
commit | 05f41884deb76dd6fa34e7d98bc147926f60a8cc (patch) | |
tree | a4d2da7197df997151a9636f663223f65a9bfd1f /erts/emulator/beam/erl_message.h | |
parent | 83b3007c6776be6e35ad8909af1a9d0707baa4d9 (diff) | |
parent | 703eea866831dea0753c5cd151d6d8d55debd470 (diff) | |
download | otp-05f41884deb76dd6fa34e7d98bc147926f60a8cc.tar.gz otp-05f41884deb76dd6fa34e7d98bc147926f60a8cc.tar.bz2 otp-05f41884deb76dd6fa34e7d98bc147926f60a8cc.zip |
Merge branch 'egil/erts/fix-purge_code-literals'
* egil/erts/fix-purge_code-literals:
erts: Refactor ERTS_MSG_COMBINED_HFRAG to heap fragment
erts: Copy literals in messages on module purge
erts: Add testcase for purge of literals
Diffstat (limited to 'erts/emulator/beam/erl_message.h')
-rw-r--r-- | erts/emulator/beam/erl_message.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_message.h b/erts/emulator/beam/erl_message.h index 4493df1c1a..46063ea0c2 100644 --- a/erts/emulator/beam/erl_message.h +++ b/erts/emulator/beam/erl_message.h @@ -369,6 +369,10 @@ ERTS_GLB_INLINE Uint erts_msg_attached_data_size(ErtsMessage *msg); #define ERTS_MSG_COMBINED_HFRAG ((void *) 0x1) +#define erts_message_to_heap_frag(MP) \ + (((MP)->data.attached == ERTS_MSG_COMBINED_HFRAG) ? \ + &(MP)->hfrag : (MP)->data.heap_frag) + #if ERTS_GLB_INLINE_INCL_FUNC_DEF ERTS_GLB_FORCE_INLINE ErtsMessage *erts_alloc_message(Uint sz, Eterm **hpp) @@ -449,10 +453,7 @@ ERTS_GLB_INLINE Uint erts_msg_attached_data_size(ErtsMessage *msg) ASSERT(msg->data.attached); if (is_value(ERL_MESSAGE_TERM(msg))) { ErlHeapFragment *bp; - if (msg->data.attached == ERTS_MSG_COMBINED_HFRAG) - bp = &msg->hfrag; - else - bp = msg->data.heap_frag; + bp = erts_message_to_heap_frag(msg); return erts_used_frag_sz(bp); } else if (msg->data.dist_ext->heap_size < 0) |