summaryrefslogtreecommitdiff
path: root/boost/align/detail/aligned_alloc_msvc.hpp
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/align/detail/aligned_alloc_msvc.hpp
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/align/detail/aligned_alloc_msvc.hpp')
-rw-r--r--boost/align/detail/aligned_alloc_msvc.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/boost/align/detail/aligned_alloc_msvc.hpp b/boost/align/detail/aligned_alloc_msvc.hpp
new file mode 100644
index 0000000000..570a898c59
--- /dev/null
+++ b/boost/align/detail/aligned_alloc_msvc.hpp
@@ -0,0 +1,35 @@
+/*
+ (c) 2014 Glen Joseph Fernandes
+ glenjofe at gmail dot com
+
+ Distributed under the Boost Software
+ License, Version 1.0.
+ http://boost.org/LICENSE_1_0.txt
+*/
+#ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP
+#define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP
+
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/align/detail/is_alignment.hpp>
+#include <cstddef>
+#include <malloc.h>
+
+namespace boost {
+ namespace alignment {
+ inline void* aligned_alloc(std::size_t alignment,
+ std::size_t size) BOOST_NOEXCEPT
+ {
+ BOOST_ASSERT(detail::is_alignment(alignment));
+ return ::_aligned_malloc(size, alignment);
+ }
+
+ inline void aligned_free(void* ptr)
+ BOOST_NOEXCEPT
+ {
+ ::_aligned_free(ptr);
+ }
+ }
+}
+
+#endif