Re: CFT: snmalloc as libc malloc

From: Floyd, Paul <paulf2718_at_gmail.com>
Date: Thu, 09 Feb 2023 13:12:35 UTC
On 09/02/2023 13:08, David Chisnall wrote:
> Hi,
>
> For the few yearsI've been running locally with snmalloc as the malloc 
> in libc.  Eventually I'd like to propose this for upstreaming but it 
> needs some wider testing first.
>
Hi

Another allocator to add to my list. I'll give it a go some time, but I 
have a lot of things on my plate at the moment.

I had a quick look. Do you support reallocf?

Looking to the fairly short term future, I couldn't see anything for the 
upcoming C23 sized/aligned free functions. It may be premature as the 
standard isn't out yet. Recently I did some work on adding a warning for 
realloc of size 0 to Valgrind (not finished code review yet). I see that 
you 'free and return NULL' (in the same camp as glibc and ptmalloc). 
However, jemalloc is in the other camp "maybe free and return a pointer 
to something" (along with Solaris and musl). That's not really an issue 
since realloc of 0 is "implementation defined". However, it is slated to 
become UB in C23.

A+

Paul