* @author Xu Ning (xning@fb.com)
*/
-#if __cplusplus >= 201402L || \
- defined __cpp_lib_make_unique && __cpp_lib_make_unique >= 201304L
+#if __cplusplus >= 201402L || \
+ (defined __cpp_lib_make_unique && __cpp_lib_make_unique >= 201304L) || \
+ (defined(_MSC_VER) && _MSC_VER >= 1900)
/* using override */ using std::make_unique;
return std::shared_ptr<T>(std::move(ptr));
}
+using SysBufferDeleter = static_function_deleter<void, ::free>;
+using SysBufferUniquePtr = std::unique_ptr<void, SysBufferDeleter>;
+inline SysBufferUniquePtr allocate_sys_buffer(size_t size) {
+ return SysBufferUniquePtr(::malloc(size));
+}
+
/**
* A SimpleAllocator must provide two methods:
*