Skip to content

Commit

Permalink
Taking page alignment adjustments into account when soring the start …
Browse files Browse the repository at this point in the history
…offset of mmaped memory (#738)
  • Loading branch information
RonFed authored Mar 28, 2024
1 parent f18c1b2 commit 170bef3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/include/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ static __always_inline void *write_target_data(void *data, s32 size)
if (success == 0)
{
s32 start_index = 0;
u64 updated_start = start + size;
// Update the start position of this chunk, taking into account possible adjustments
// we made to be page aligned
u64 updated_start = target_u + size;

// align updated_start to 8 bytes
if (updated_start % 8 != 0) {
Expand Down

0 comments on commit 170bef3

Please sign in to comment.