Use __declspec(allocator) for malloc-like prototypes (MS VS 2015+)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 20 Oct 2017 18:15:54 +0000 (21:15 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 20 Oct 2017 18:15:54 +0000 (21:15 +0300)
* include/gc_config_macros.h [_MSC_VER>=1900 && !__EDG__]
(GC_ATTR_MALLOC): Add __declspec(allocator).

include/gc_config_macros.h

index 3d64dfe..38752d6 100644 (file)
 #   define GC_ATTR_MALLOC /* empty */
 # elif GC_GNUC_PREREQ(3, 1)
 #   define GC_ATTR_MALLOC __attribute__((__malloc__))
+# elif defined(_MSC_VER) && (_MSC_VER >= 1900) && !defined(__EDG__)
+#   define GC_ATTR_MALLOC \
+                __declspec(allocator) __declspec(noalias) __declspec(restrict)
 # elif defined(_MSC_VER) && _MSC_VER >= 1400
 #   define GC_ATTR_MALLOC __declspec(noalias) __declspec(restrict)
 # else