summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 14:48:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 14:48:20 +0000
commitb7c6db94ae2b9532640609163099c738decb31e6 (patch)
tree3ad8430052846cefef81706dc9d4edba1b0964ab /gc.c
parent7e1f3c636b317571141c9a0ca778a088f7c22ccb (diff)
gc.c: use malloc_size
* configure.in: check malloc_size() available on BSD. * gc.c: use malloc_size() with malloc/malloc.h on BSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 0e6aad6f14..ddf607ce20 100644
--- a/gc.c
+++ b/gc.c
@@ -39,12 +39,18 @@
# ifdef _WIN32
# define HAVE_MALLOC_USABLE_SIZE
# define malloc_usable_size(a) _msize(a)
+# elif defined HAVE_MALLOC_SIZE
+# define HAVE_MALLOC_USABLE_SIZE
+# define malloc_usable_size(a) malloc_size(a)
# endif
-#else
+#endif
+#ifdef HAVE_MALLOC_USABLE_SIZE
# ifdef HAVE_MALLOC_H
# include <malloc.h>
# elif defined(HAVE_MALLOC_NP_H)
# include <malloc_np.h>
+# elif defined(HAVE_MALLOC_MALLOC_H)
+# include <malloc/malloc.h>
# endif
#endif