From 1aba4f41a3fef53fa913e655444dbba53a0c82df Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Tue, 13 Feb 2024 14:37:21 -0800 Subject: [PATCH] Allow zero sized memalign to pass. Instead of failing on assertions. Previously the same change was made for posix_memalign and aligned_alloc (#1554). Make memalign behave the same way even though it's obsolete. --- src/jemalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jemalloc.c b/src/jemalloc.c index 88436f45..7934e767 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -3052,6 +3052,7 @@ je_memalign(size_t alignment, size_t size) { static_opts_init(&sopts); dynamic_opts_init(&dopts); + sopts.bump_empty_aligned_alloc = true; sopts.min_alignment = 1; sopts.oom_string = ": Error allocating aligned memory: out of memory\n";