aboutsummaryrefslogtreecommitdiff
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorEugene Uriev <eugeneuriev@gmail.com>2024-03-31 23:03:23 +0300
committerTom Rini <trini@konsulko.com>2024-04-12 16:23:06 -0600
commitae838768d79cbb834c4a8a5f4810df373e58b622 (patch)
treead65d99ccd7aac92d665f337bd13ef3d73943faa /common/dlmalloc.c
parent151493a875071448e2582489f6fa84d1630b3368 (diff)
downloadu-boot-ae838768d79cbb834c4a8a5f4810df373e58b622.zip
u-boot-ae838768d79cbb834c4a8a5f4810df373e58b622.tar.gz
u-boot-ae838768d79cbb834c4a8a5f4810df373e58b622.tar.bz2
mcheck: support memalign
Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 8de15d7..73c04af 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -2265,7 +2265,12 @@ Void_t *rEALLOc(Void_t *oldmem, size_t bytes)
Void_t *mEMALIGn(size_t alignment, size_t bytes)
{
- return NULL;
+ size_t fullsz = mcheck_memalign_prehook(alignment, bytes);
+ void *p = mEMALIGn_impl(alignment, fullsz);
+
+ if (!p)
+ return p;
+ return mcheck_memalign_posthook(alignment, p, bytes);
}
// pvALLOc, vALLOc - redirect to mEMALIGn, defined here, so they need no wrapping.