From c3ef7a528b1fdfe7fc98b846fd2ccb0c07443682 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 15 Sep 2023 23:08:59 +0200 Subject: [PATCH] Fix malloc_trim() on wasm32 ``` compiling gc.c gc.c:9746:5: error: implicit declaration of function 'malloc_trim' is invalid in C99 [-Werror,-Wimplicit-function-declaration] malloc_trim(0); ^ 1 error generated. ``` --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index aa74345405..ffbbee7115 100644 --- a/gc.c +++ b/gc.c @@ -48,7 +48,7 @@ # endif #endif -#ifdef HAVE_MALLOC_USABLE_SIZE +#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_TRIM) # ifdef RUBY_ALTERNATIVE_MALLOC_HEADER /* Alternative malloc header is included in ruby/missing.h */ # elif defined(HAVE_MALLOC_H)