Skip to content

Commit

Permalink
Merge branch 'lukas/erts/fix-dt-aligned-bytes/OTP-19333' into maint
Browse files Browse the repository at this point in the history
* lukas/erts/fix-dt-aligned-bytes/OTP-19333:
  erts: Fix hsz calculation for messages when using vm probes
  erts: Fix dt temp buffer type
  • Loading branch information
garazdawi committed Nov 4, 2024
2 parents ac33280 + 7ce9cbc commit 9529063
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions erts/emulator/beam/bif.c
Original file line number Diff line number Diff line change
Expand Up @@ -5659,15 +5659,14 @@ BIF_RETTYPE dt_prepend_vm_tag_data_1(BIF_ALIST_1)
#ifdef USE_VM_PROBES
Eterm b;
Eterm *hp;
if (is_bitstring((DT_UTAG(BIF_P)))) {
byte *temp_alloc = NULL;
const byte *p;
const byte *temp_alloc = NULL;
const byte *p;
Uint size;
if (p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),
&size,
&temp_alloc)) {
byte *q;
Uint size;
Uint i;
p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),
&size,
&temp_alloc);
b = erts_new_binary(BIF_P, (size + 1), &q);
for(i = 0; i < size; i++) {
q[i] = p[i];
Expand All @@ -5688,11 +5687,13 @@ BIF_RETTYPE dt_append_vm_tag_data_1(BIF_ALIST_1)
#ifdef USE_VM_PROBES
Eterm b;
Eterm *hp;
if (is_bitstring((DT_UTAG(BIF_P)))) {
byte *temp_alloc = NULL;
const byte *p;
const byte *temp_alloc = NULL;
const byte *p;
Uint size;
if (p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),
&size,
&temp_alloc)) {
byte *q;
Uint size;
Uint i;
p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),
&size,
Expand Down
6 changes: 3 additions & 3 deletions erts/emulator/beam/erl_proc_sig_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ send_gen_exit_signal(ErtsPTabElementCommon *sender, Eterm from_tag,
ErtsMessage *mp;
ErlHeapFragment *hfrag;
ErlOffHeap *ohp;
Uint hsz, from_sz, reason_sz, ref_sz, token_sz, dist_ext_sz = 0;
Uint hsz = 0, from_sz, reason_sz, ref_sz, token_sz, dist_ext_sz = 0;
int seq_trace, has_token;
Process *c_p;
#ifdef USE_VM_PROBES
Expand Down Expand Up @@ -1610,12 +1610,12 @@ send_gen_exit_signal(ErtsPTabElementCommon *sender, Eterm from_tag,

has_token = !is_nil(token);
if (has_token) {
hsz = sizeof(ErtsSeqTokenExitSignalData)/sizeof(Eterm);
hsz += sizeof(ErtsSeqTokenExitSignalData)/sizeof(Eterm);
token_sz = size_object(token);
hsz += token_sz;
}
else {
hsz = sizeof(ErtsExitSignalData)/sizeof(Eterm);
hsz += sizeof(ErtsExitSignalData)/sizeof(Eterm);
token_sz = 0;
}

Expand Down

0 comments on commit 9529063

Please sign in to comment.