• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 Copyright 2014 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4 
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7 */
8 #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP
9 #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP
10 
11 #include <boost/align/detail/is_alignment.hpp>
12 #include <boost/assert.hpp>
13 #include <malloc.h>
14 
15 namespace boost {
16 namespace alignment {
17 
18 inline void*
aligned_alloc(std::size_t alignment,std::size_t size)19 aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT
20 {
21     BOOST_ASSERT(detail::is_alignment(alignment));
22     return ::_aligned_malloc(size, alignment);
23 }
24 
25 inline void
aligned_free(void * ptr)26 aligned_free(void* ptr) BOOST_NOEXCEPT
27 {
28     ::_aligned_free(ptr);
29 }
30 
31 } /* alignment */
32 } /* boost */
33 
34 #endif
35