[PATCH] Fix malloc_usable_size definition on Android

Mike Hommey mh+jemalloc at glandium.org
Wed May 21 03:51:33 PDT 2014


On Wed, May 21, 2014 at 07:04:20PM +0900, Mike Hommey wrote:
> From: Mike Hommey <mh at glandium.org>
> 
> ---
>  configure.ac | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 57015d1..0f0d9a4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -286,7 +286,14 @@ case "${host}" in
>  	AC_DEFINE([JEMALLOC_HAS_ALLOCA_H])
>  	AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
>  	AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
> -	JEMALLOC_USABLE_SIZE_CONST=""
> +	dnl Android's libc defines malloc_usable_size with a const void*
> +	dnl argument.
> +	case "${host}" in
> +	  *android*) ;;
> +          *)
> +		JEMALLOC_USABLE_SIZE_CONST=""
> +		;;
> +	esac

This patch is unfortunately wrong, because there was a definition with
void* before Kitkat.

https://github.com/android/platform_bionic/commit/25a87f7641f066437d15c6d3148d08a6ab9be231

Mike


More information about the jemalloc-discuss mailing list