Note jemalloc >= 5.1 is required to fix a bug with 0 sizes.
How serious is the bug? What are the symptoms?
I've updated the commit summary to say it's a crash.
Arguably that's better than mem corruption.
It looks like 5.1.0 is less than a year old, so older versions are
presumably still in wide use.
We could potentially workaround it by making
new_allocator::allocate(0) call ::operator new(1) when
__cpp_sized_deallocation is defined, and deallocate(p, 0) call
::operator delete(p, 1). Obviously I'd prefer not to do that, because
the default operator new already has an equivalent check, and only
programs linking to jemalloc require the workaround.
Right the jemalloc fix was released May 2018.
It would be great to avoid the extra workarounds.
Given this would be released about a year after the jemalloc fix was
released,
and that this would only manifest upon program rebuild,
I would be inclined to not add any workarounds.
For reference tcmalloc and glibc malloc were seen to work fine with this.