Skip to content

Commit

Permalink
Fix #418, memory alignment in PCS_malloc stub
Browse files Browse the repository at this point in the history
Correct the round-up memory alignment calculation in the
stub "malloc" routine.
  • Loading branch information
jphickey committed Nov 13, 2023
1 parent 2227810 commit e28fa2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unit-test-coverage/ut-stubs/src/libc-stdlib-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void *PCS_malloc(size_t sz)
return NULL;
}

NextSize = (NextSize + MPOOL_ALIGN - 1) & ~((size_t)MPOOL_ALIGN);
NextSize = (NextSize + MPOOL_ALIGN - 1) & ~((size_t)MPOOL_ALIGN - 1);
NextBlock = Rec->BlockAddr + MPOOL_ALIGN;
Rec->BlockAddr += NextSize;
Rec->Size += NextSize;
Expand Down

0 comments on commit e28fa2f

Please sign in to comment.