Fix malloc_trim on emscripten
``` gc.c:9746:5: error: implicit declaration of function 'malloc_trim' is invalid in C99 [-Werror,-Wimplicit-function-declaration] malloc_trim(0); ^ ``` http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-wasm32_emscripten/log/20230916T104311Z.fail.html.gz
This commit is contained in:
parent
a8afedce6d
commit
209d5f8482
6
gc.c
6
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 <malloc.h>
|
||||
#endif
|
||||
|
||||
#if !defined(PAGE_SIZE) && defined(HAVE_SYS_USER_H)
|
||||
/* LIST_HEAD conflicts with sys/queue.h on macOS */
|
||||
# include <sys/user.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user