diff --git a/gc.c b/gc.c index ffbbee7115..cc4406c0c9 100644 --- a/gc.c +++ b/gc.c @@ -48,7 +48,7 @@ # endif #endif -#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_TRIM) +#ifdef HAVE_MALLOC_USABLE_SIZE # ifdef RUBY_ALTERNATIVE_MALLOC_HEADER /* Alternative malloc header is included in ruby/missing.h */ # elif defined(HAVE_MALLOC_H) @@ -60,6 +60,10 @@ # endif #endif +#ifdef HAVE_MALLOC_TRIM +# include +#endif + #if !defined(PAGE_SIZE) && defined(HAVE_SYS_USER_H) /* LIST_HEAD conflicts with sys/queue.h on macOS */ # include