1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-11-21 09:52:09 +00:00
parent 7800a4b566
commit 1a2997b299
2 changed files with 7 additions and 0 deletions

View file

@ -1009,6 +1009,7 @@ main()
ac_cv_type_struct_timeval=yes
ac_cv_func_clock_gettime=yes
ac_cv_func_clock_getres=yes
ac_cv_func_malloc_usable_size=no
AC_CHECK_TYPE([NET_LUID], [], [],
[@%:@include <windows.h>
@%:@include <iphlpapi.h>])

6
gc.c
View file

@ -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 */