diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-18 19:45:42 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-20 18:34:52 +0200 |
commit | 703eea866831dea0753c5cd151d6d8d55debd470 (patch) | |
tree | 8fc72e0f1499bd0ff1129d094c258b4125fdf899 /erts/emulator/beam/erl_message.h | |
parent | 9effc6a6c52d9c492925c4271743d06d68d04bcb (diff) | |
download | otp-703eea866831dea0753c5cd151d6d8d55debd470.tar.gz otp-703eea866831dea0753c5cd151d6d8d55debd470.tar.bz2 otp-703eea866831dea0753c5cd151d6d8d55debd470.zip |
erts: Refactor ERTS_MSG_COMBINED_HFRAG to heap fragment
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 851ac37fda..ecf65ca324 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) |