summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 09:52:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 09:52:09 +0000
commit1a2997b299151e202ca88082161e86ec688d883b (patch)
treefac7bf60a90ab407dafb15b1c0703d3f70cd208e /gc.c
parent7800a4b566d06ad8028a0793e50467bc233040c7 (diff)
gc.c: malloc_usable_size
* gc.c (malloc_usable_size): use _msize() on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index c15b19c44f..9963cdec52 100644
--- a/gc.c
+++ b/gc.c
@@ -35,6 +35,12 @@
# define __has_feature(x) 0
#endif
+#ifndef HAVE_MALLOC_USABLE_SIZE
+# ifdef _WIN32
+# define malloc_usable_size(a) _msize(a)
+# endif
+#endif
+
#if /* is ASAN enabled? */ \
__has_feature(address_sanitizer) /* Clang */ || \
defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x */