Skip to content

Commit

Permalink
Merge pull request #77093 from RandomShaper/fix_mq_copy
Browse files Browse the repository at this point in the history
Fix transfer of messages between queues
  • Loading branch information
akien-mga committed May 15, 2023
2 parents 5adac3c + 93de529 commit 5c653c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/object/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Error CallQueue::flush() {
uint32_t dst_page = mq->pages_used - 1;
uint32_t dst_offset = mq->page_bytes[dst_page];
if (dst_offset + page_bytes[0] < uint32_t(PAGE_SIZE_BYTES)) {
memcpy(mq->pages[dst_page] + dst_offset, pages[0], page_bytes[0]);
memcpy(mq->pages[dst_page]->data + dst_offset, pages[0]->data, page_bytes[0]);
src_page++;
}
}
Expand All @@ -253,7 +253,7 @@ Error CallQueue::flush() {

for (; src_page < pages_used; src_page++) {
mq->_add_page();
memcpy(mq->pages[mq->pages_used - 1], pages[src_page], page_bytes[src_page]);
memcpy(mq->pages[mq->pages_used - 1]->data, pages[src_page]->data, page_bytes[src_page]);
mq->page_bytes[mq->pages_used - 1] = page_bytes[src_page];
}

Expand Down

0 comments on commit 5c653c2

Please sign in to comment.