Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wutmalloc: Always align allocated memory to 0x40 to match newlib behaviour #316

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libraries/wutmalloc/wut_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ __fini_wut_malloc(void)
void *
_malloc_r(struct _reent *r, size_t size)
{
void *ptr = MEMAllocFromDefaultHeap(size);
void *ptr = MEMAllocFromDefaultHeapEx(size, 0x40);
if (!ptr) {
r->_errno = ENOMEM;
}
Expand All @@ -36,7 +36,7 @@ _free_r(struct _reent *r, void *ptr)
void *
_realloc_r(struct _reent *r, void *ptr, size_t size)
{
void *new_ptr = MEMAllocFromDefaultHeap(size);
void *new_ptr = MEMAllocFromDefaultHeapEx(size, 0x40);
if (!new_ptr) {
r->_errno = ENOMEM;
return new_ptr;
Expand All @@ -53,7 +53,7 @@ _realloc_r(struct _reent *r, void *ptr, size_t size)
void *
_calloc_r(struct _reent *r, size_t num, size_t size)
{
void *ptr = MEMAllocFromDefaultHeap(num * size);
void *ptr = MEMAllocFromDefaultHeapEx(num * size, 0x40);
if (ptr) {
memset(ptr, 0, num * size);
} else {
Expand Down