[PATCH v2 2/2] malloc: introduce ifuncs for malloc functions

Yury Khrustalev yury.khrustalev@arm.com
Wed Apr 22 13:30:35 GMT 2026


On Mon, Apr 20, 2026 at 03:14:59PM +0100, Yury Khrustalev wrote:
> Introduce ifuncs and resolvers for functions pertinent to the
> malloc interface.
>
> ...
>
> diff --git a/sysdeps/generic/malloc-ifuncs.c b/sysdeps/generic/malloc-ifuncs.c
> new file mode 100644
> index 0000000000..0c03c1466e
> --- /dev/null
> +++ b/sysdeps/generic/malloc-ifuncs.c
> @@ -0,0 +1,94 @@
>
> ...
>
> +#if IS_IN (libc)
> +
> +#include <malloc/malloc-internal.h>
> +#include <malloc-ifuncs.h>

I've noticed that this file fails to compile for Hurd targets because
malloc-internal.h includes calloc-clear-memory.h that has function
clear_memory() that uses memset(), and on Hurd it needs string.h.

The random inclusion of string.h in malloc.c (see above) seems to be
solving this issue. I think it's better to include string.h in the
calloc-clear-memory.h header that actually uses this function.

I will fix it in the next version of this patch.



More information about the Libc-alpha mailing list